code: def test_unrelated_history_merge(tmp_path):
      # prepare two independent datasets and try merging one into another
      ds = Dataset(tmp_path / "ds").create()
      repo = AnnexRepo(tmp_path / "repo")
      f = tmp_path / "repo" / "file.dat"
      f.write_text("data")
      repo.add(str(f))
      repo.commit()
      # ATM we do not do any checks and allow such addition
      assert_status(
          "ok", ds.siblings(action="add", name="repo", url=repo.path)
      )
      res = ds.update(how="merge", on_failure="ignore")
      # ATM we do not have any special handling, just that the first result record
      # would have that error in "message" field
      assert_status("error", res[0])
      assert_in(
          "refusing to merge unrelated histories", res[0]["message"]
      )
  
imports: import os
  import os.path
  from os.path import exists
  from os.path import join
  from unittest.mock import patch
  import pytest
  from datalad import cfg
  from datalad.api import clone, install, remove, update
  from datalad.distribution.update import _process_how_args
  from datalad.support.annexrepo import AnnexRepo
  from datalad.support.external_versions import external_versions
  from datalad.support.gitrepo import GitRepo
  from datalad.tests.utils_pytest import DEFAULT_BRANCH, DEFAULT_REMOTE, SkipTest, assert_false, assert_in, assert_in_results, assert_is_instance, assert_not_in, assert_raises, assert_repo_status, assert_result_count, assert_status, create_tree, eq_, known_failure_windows, maybe_adjust_repo, neq_, ok_, ok_file_has_content, skip_if_adjusted_branch, slow, with_tempfile
  from datalad.utils import Path, chpwd, knows_annex, rmtree
  from ..dataset import Dataset
label_desc: Use image node_id 8 for calling a global function with example usage: test_unrelated_history_merge(tmp_path) without return types