code: def test_update_recursive(tmp_dir, dvc, erepo_dir):
      with erepo_dir.branch("branch", new=True), erepo_dir.chdir():
          erepo_dir.scm_gen(
              {"foo1": "text1", "foo2": "text2", "foo3": "text3"},
              commit="add foo files",
          )
          old_rev = erepo_dir.scm.get_rev()
  
      tmp_dir.gen({"dir": {"subdir": {}}})
      stage1 = dvc.imp(
          os.fspath(erepo_dir),
          "foo1",
          os.path.join("dir", "foo1"),
          rev="branch",
      )
      stage2 = dvc.imp(
          os.fspath(erepo_dir),
          "foo2",
          os.path.join("dir", "subdir", "foo2"),
          rev="branch",
      )
      stage3 = dvc.imp(
          os.fspath(erepo_dir),
          "foo3",
          os.path.join("dir", "subdir", "foo3"),
          rev="branch",
      )
  
      assert (
          tmp_dir / os.path.join("dir", "foo1")
      ).read_text() == "text1"
      assert (
          tmp_dir / os.path.join("dir", "subdir", "foo2")
      ).read_text() == "text2"
      assert (
          tmp_dir / os.path.join("dir", "subdir", "foo3")
      ).read_text() == "text3"
  
      assert stage1.deps[0].def_repo["rev_lock"] == old_rev
      assert stage2.deps[0].def_repo["rev_lock"] == old_rev
      assert stage3.deps[0].def_repo["rev_lock"] == old_rev
  
      with erepo_dir.branch("branch", new=False), erepo_dir.chdir():
          erepo_dir.scm_gen(
              {
                  "foo1": "updated1",
                  "foo2": "updated2",
                  "foo3": "updated3",
              },
              "",
              "update foo content",
          )
          new_rev = erepo_dir.scm.get_rev()
  
      assert old_rev != new_rev
  
      dvc.update(["dir"], recursive=True)
  
      stage1 = load_file(dvc, stage1.path).stage
      stage2 = load_file(dvc, stage2.path).stage
      stage3 = load_file(dvc, stage3.path).stage
      assert stage1.deps[0].def_repo["rev_lock"] == new_rev
      assert stage2.deps[0].def_repo["rev_lock"] == new_rev
      assert stage3.deps[0].def_repo["rev_lock"] == new_rev
  
imports: import os
  import pytest
  from dvc.dependency import base
  from dvc.dvcfile import load_file
  from dvc.exceptions import InvalidArgumentError
  from dvc.testing.tmp_dir import make_subrepo
label_desc: Use image node_id 10 for calling a global function with example usage: test_update_recursive(tmp_dir, dvc, erepo_dir) without return types