# # # add_dir "tests/two_parent_workspace_inodeprint_from_birth" # # add_file "tests/two_parent_workspace_inodeprint_from_birth/__driver__.lua" # content [91c35d3bc8db43af0cf1eeb1a3b67c66c0351eb2] # # patch "ChangeLog" # from [73199c6255a7f3aed099c416c59da2411417b553] # to [66e41a392bb05590d776ab8f2f64af2ed5f9286f] # # patch "tests/two_parent_workspace_inodeprints/__driver__.lua" # from [9b5379110d0f2750ab71e9abcdef7235630f7a71] # to [cb9175dd15771248cc7d53864fa77c17b9d09802] # # patch "testsuite.lua" # from [ffbcf558e31a64c8e9f12923c1d708430fe82e0e] # to [9ffda7287e46df17d324e0118efee5302aaf86f4] # ============================================================ --- tests/two_parent_workspace_inodeprint_from_birth/__driver__.lua 91c35d3bc8db43af0cf1eeb1a3b67c66c0351eb2 +++ tests/two_parent_workspace_inodeprint_from_birth/__driver__.lua 91c35d3bc8db43af0cf1eeb1a3b67c66c0351eb2 @@ -0,0 +1,72 @@ +mtn_setup() + +-- enable inodeprints +writefile("_MTN/inodeprints") + +-- create common ancestor +addfile("foo", "ancestor\nancestor") +addfile("bar", "bar content") +sleep(5) +check(not qgrep("foo", "_MTN/inodeprints")) +commit() +check(qgrep("foo", "_MTN/inodeprints")) +anc = base_revision() + +-- create first child from ancestor (left) +writefile("foo", "left\nancestor") +addfile("left", "only on left") +check(qgrep("foo", "_MTN/inodeprints")) +check(not qgrep("left", "_MTN/inodeprints")) +sleep(5) +commit() +check(qgrep("foo", "_MTN/inodeprints")) +check(qgrep("left", "_MTN/inodeprints")) +check(not qgrep("right", "_MTN/inodeprints")) +other = base_revision() +remove("left") + +-- create second child from ancestor (right) +revert_to(anc) +sleep(5) +check(mtn("refresh_inodeprints"), 0, false, false) + +check(qgrep("foo", "_MTN/inodeprints")) +check(not qgrep("right", "_MTN/inodeprints")) +writefile("foo", "ancestor\nright") +addfile("right", "only on right") +sleep(5) +check(qgrep("foo", "_MTN/inodeprints")) +check(not qgrep("right", "_MTN/inodeprints")) +commit() +check(not qgrep("left", "_MTN/inodeprints")) +check(qgrep("right", "_MTN/inodeprints")) +check(qgrep("foo", "_MTN/inodeprints")) + +-- now create a two parent workspace +check(mtn("merge_into_workspace", other), 0, false, false) + +check(fsize("_MTN/inodeprints") ~= 0) + +-- foo is changed in the workspace, so it shouldn't be inodeprinted +check(not qgrep("foo", "_MTN/inodeprints")) + +-- bar was only touched in the common ancestor +check(qgrep("bar", "_MTN/inodeprints")) + +-- left and right are unchanged, but added in the other parent, so should be +-- inodeprinted, except that left was added during the merge_into_workspace, +-- so it's too new to be inodeprinted +check(not qgrep("left", "_MTN/inodeprints")) +check(qgrep("right", "_MTN/inodeprints")) + +-- wait a bit, refresh, and check that left shows up now +sleep(5) +check(mtn("refresh_inodeprints")) +check(qgrep("left", "_MTN/inodeprints")) + +-- test explicit refresh_inodeprints +addfile("in-two-parent", "in-two-parent's file content") +sleep(5) +check(mtn("refresh_inodeprints"), 0, false, false) +check(fsize("_MTN/inodeprints") ~= 0) +check(qgrep("in-two-parent", "_MTN/inodeprints")) ============================================================ --- ChangeLog 73199c6255a7f3aed099c416c59da2411417b553 +++ ChangeLog 66e41a392bb05590d776ab8f2f64af2ed5f9286f @@ -1,3 +1,12 @@ +2007-02-10 Matthew Gregan + + * tests/two_parent_workspace_inodeprint_from_birth: Add another + inodeprints test, this time ensuring that multi-parent workspaces + and inodeprints interact correctly when inodeprints have were + enabled prior to the merge_into_workspace taking place. + * testsuite.lua: Add it. + * tests/two_parent_workspace_inodeprints: Tweak test. + 2007-02-09 Zack Weinberg * cmd_merging.cc (merge_into_workspace): Use get_content_paths. ============================================================ --- tests/two_parent_workspace_inodeprints/__driver__.lua 9b5379110d0f2750ab71e9abcdef7235630f7a71 +++ tests/two_parent_workspace_inodeprints/__driver__.lua cb9175dd15771248cc7d53864fa77c17b9d09802 @@ -27,22 +27,19 @@ check(qgrep("patched[ ]\+foo", "stdout" check(mtn("status"), 0, true, false) check(qgrep("patched[ ]\+foo", "stdout")) -addfile("bar", "this is bar") sleep(5) check(fsize("_MTN/inodeprints") == 0) - commit() - check(fsize("_MTN/inodeprints") ~= 0) + +check(qgrep("foo", "_MTN/inodeprints")) check(qgrep("left", "_MTN/inodeprints")) check(qgrep("right", "_MTN/inodeprints")) addfile("in-two-parent", "in-two-parent's file content") -sleep(5) -check(mtn("refresh_inodeprints"), 0, false, false) -check(fsize("_MTN/inodeprints") ~= 0) check(not qgrep("in-two-parent", "_MTN/inodeprints")) +sleep(5) commit() check(qgrep("in-two-parent", "_MTN/inodeprints")) ============================================================ --- testsuite.lua ffbcf558e31a64c8e9f12923c1d708430fe82e0e +++ testsuite.lua 9ffda7287e46df17d324e0118efee5302aaf86f4 @@ -717,5 +717,6 @@ table.insert(tests, "two_parent_workspac table.insert(tests, "two_parent_workspace_attrs") table.insert(tests, "two_parent_workspace_pivot_root") table.insert(tests, "two_parent_workspace_inodeprints") +table.insert(tests, "two_parent_workspace_inodeprint_from_birth") table.insert(tests, "two_parent_workspace_annotate") table.insert(tests, "two_parent_workspace_list")