code: def test_rerun_multifork(path=None):
      ds = Dataset(path).create()
      # keep direct repo accessor to speed things up
      ds_repo = ds.repo
      ds_repo.checkout(DEFAULT_BRANCH, options=["-b", "side"])
      ds.run("echo foo >foo")
      ds_repo.checkout("side", options=["-b", "side-nonrun"])
      with open(op.join(path, "nonrun-file0"), "w") as f:
          f.write("blah 0")
      ds.save()
      ds_repo.checkout("side")
      with open(op.join(path, "nonrun-file1"), "w") as f:
          f.write("blah 1")
      ds.save()
      ds.run("echo bar >bar")
      ds_repo.checkout("side~1", options=["-b", "side-side"])
      with open(op.join(path, "nonrun-file2"), "w") as f:
          f.write("blah 2")
      ds.save()
      ds.run("echo onside0 >onside0")
      ds_repo.checkout("side")
      ds_repo.merge("side-side")
      ds.run("echo after-side-side >after-side-side")
      ds_repo.checkout(DEFAULT_BRANCH)
      ds_repo.merge("side", options=["--no-ff"])
      ds_repo.merge("side-nonrun")
      # o                 k_n
      # |\
      # | o               j_n
      # o |               i_n
      # |\ \
      # | o |             h_r
      # | o |             g_n
      # | |\ \
      # | | o |           f_r
      # | | o |           e_n
      # | o | |           d_r
      # | |/ /
      # | o |             c_n
      # | |/
      # | o               b_r
      # |/
      # o                 a_n
  
      ds.rerun(since="", onto="")
      # o                 k_M
      # |\
      # | o               j_n
      # o |               i_M
      # |\ \
      # | o |             h_R
      # | o |             g_M
      # | |\ \
      # | | o |           f_R
      # | | o |           e_n
      # | o | |           d_R
      # | |/ /
      # | o |             c_n
      # | |/
      # | o               b_R
      # |/
      # o                 a_n
      eq_(
          ds_repo.get_hexsha("HEAD~2"),
          ds_repo.get_hexsha(DEFAULT_BRANCH + "~2"),
      )
      neq_(
          ds_repo.get_hexsha("HEAD^2"),
          ds_repo.get_hexsha(DEFAULT_BRANCH + "^2"),
      )
      neq_(
          ds_repo.get_hexsha("HEAD^^2"),
          ds_repo.get_hexsha(DEFAULT_BRANCH + "^^2"),
      )
      assert_false(ds_repo.commit_exists("HEAD^^2^2"))
      eq_(
          ds_repo.get_hexsha("HEAD^2^^"),
          ds_repo.get_hexsha(DEFAULT_BRANCH + "^2^^"),
      )
  
      ds_repo.checkout(DEFAULT_BRANCH)
      hexsha_before = ds_repo.get_hexsha()
      ds.rerun(since="")
      eq_(hexsha_before, ds_repo.get_hexsha())
  
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 14 for calling a global function with example usage: test_rerun_multifork(path) without return types