code: def test_rerun_octopus(path=None):
      ds = Dataset(path).create()
      # keep direct repo accessor to speed things up
      ds_repo = ds.repo
      ds.run("echo foo >>foo")
      with open(op.join(ds.path, "non-run"), "w") as nrfh:
          nrfh.write("non-run")
      ds.save()
      ds_repo.checkout(DEFAULT_BRANCH + "~", options=["-b", "topic-1"])
      ds.run("echo bar >bar")
      ds_repo.checkout(DEFAULT_BRANCH + "~", options=["-b", "topic-2"])
      ds.run("echo baz >baz")
      ds_repo.checkout(DEFAULT_BRANCH)
      ds_repo.call_git(
          ["merge", "-m", "Merge octopus", "topic-1", "topic-2"]
      )
      # o-.               f_M
      # |\ \
      # | | o             e_r
      # | o |             d_r
      # | |/
      # o |               c_n
      # |/
      # o                 b_r
      # o                 a_n
  
      ds.rerun(since="", onto="")
      neq_(
          ds_repo.get_hexsha("HEAD^3"),
          ds_repo.get_hexsha(DEFAULT_BRANCH + "^3"),
      )
      eq_(
          ds_repo.get_hexsha("HEAD~3"),
          ds_repo.get_hexsha(DEFAULT_BRANCH + "~3"),
      )
  
      ds_repo.checkout(DEFAULT_BRANCH)
      hexsha_before = ds_repo.get_hexsha()
      ds.rerun(since="")
      eq_(hexsha_before, ds_repo.get_hexsha(DEFAULT_BRANCH + "~"))
  
file_path: datalad/datalad/local/tests/test_rerun_merges.py
imports: import os.path
  from datalad.distribution.dataset import Dataset
  from datalad.tests.utils_pytest import DEFAULT_BRANCH, assert_false, eq_, neq_, ok_, skip_if_adjusted_branch, slow, with_tempfile
label_desc: Use image node_id 15 for calling a global function with example usage: test_rerun_octopus(path) without return types