# # # rename "tests/restriction_excludes_parent_dir" # to "tests/restriction_includes_parent_dir" # # add_file "tests/automate_inventory_options/expected-renames-target-no-unchanged.stdout" # content [fc960c1c87ed1111a6dd8dee9a5e9423aaf28c78] # # patch "tests/automate_inventory_ignore_dirs/expected.stderr" # from [8d34d463808ddf9b868d0e415a571ff18002388b] # to [c8c0d4ace900124f27930a2cda3a36bae788a7d6] # # patch "tests/automate_inventory_ignore_dirs/expected.stdout" # from [ee97eb075d7fb94084672c6867355bd72728d9ef] # to [7953c6c570505b936fbd359736a3f88f36d28c77] # # patch "tests/automate_inventory_ignore_dirs/expected_2.stderr" # from [9937d25da7c3bd55a10ba16018fade6ee9562e92] # to [f3a33a7222dbad2cf409a5a085b89366600a1abf] # # patch "tests/automate_inventory_ignore_dirs/expected_2.stdout" # from [cd896018adbe95b59dd286c8f78080bb99073af7] # to [9d91c961f4f49cedf3469b3c7f5d12e4ed2bb672] # # patch "tests/automate_inventory_options/__driver__.lua" # from [f2bbe3b9ec462bc791f29419b1f88052bf6199d6] # to [3a0944057bf7a7bda8d5efb98a3769c130885996] # # patch "tests/automate_inventory_options/expected-no-ignored.stdout" # from [8d87531d633398ec074c79a1196ab3fe3461437c] # to [e658e6d766eaea69fe250e183d2022bd4566ff87] # # patch "tests/automate_inventory_options/expected-no-unknown.stdout" # from [6f89120110a15a4979689a11d984037858245f60] # to [1f4d4a2f5a6d76dba47188c9923af374e9f9190d] # # patch "tests/automate_inventory_options/expected-none.stdout" # from [8b56b8744aa7c03ece83e8f947a989b7afa66ed1] # to [2eb25238f0890aed450e7d48ed30cda0dfb43a79] # # patch "tests/automate_inventory_options/expected-renames-both.stdout" # from [30c148e193838a02d0e041f8befc0c7d6b29c646] # to [6b0e385e1cb8ad6765802174e98d6a50a9437d1e] # # patch "tests/automate_inventory_options/expected-renames-source.stdout" # from [98075ff38b8a5622ea05d4969880fa2be741bbf3] # to [339e4fb242f37a9c7238ec6c4fb4e5192ebb4910] # # patch "tests/automate_inventory_options/expected-renames-target-no-ignored.stdout" # from [208a14ecc012d3880e47db2af06eef124f83ce1c] # to [b627a5322e81f77f02f057e937b168323330e519] # # patch "tests/automate_inventory_options/expected-renames-target-no-unknown.stdout" # from [ae4773015e235754db26b51ceab35cf5944e7a5e] # to [efc3652de86150f2a04889249f05392ac4b010d2] # # patch "tests/automate_inventory_options/expected-renames-target.stdout" # from [fc960c1c87ed1111a6dd8dee9a5e9423aaf28c78] # to [163fbd543b823a162d42fae2bad9ff5ef923f59e] # # patch "tests/automate_inventory_restricted/__driver__.lua" # from [ffb529f5c0632466857eaa24848d39e1cc1577d6] # to [e24990972a5fe7b2ac00d415f91e94a28d3cbf92] # # patch "tests/diff_against_empty_file/__driver__.lua" # from [5ce91b780f24a07fa350b5123c3a8f408f2e7061] # to [694232efef6d74dc0bd435e5108d2f8e474c8415] # # patch "tests/diff_on_missing_trailing_newline_at_end_of_file/__driver__.lua" # from [6075a66de87b656791ec862445c54a922a789eaa] # to [2a22c345e9f38c7d615dbf0d8f27b1a603c6be20] # # patch "tests/diff_restriction_renamed_parent/__driver__.lua" # from [5d5547bc3ffacc13fb27a3adc1a7414279149510] # to [b6153bce8014680b1d322c6899ad845c2f3f627d] # # patch "tests/fetching_nonexistent_entry_from_children_bug/__driver__.lua" # from [4b82854d39018a121885571307a4747b79f0d6e0] # to [002f11175ac82b1b41427efc3136d1388f444f97] # # patch "tests/log_dir/__driver__.lua" # from [8b1e8d2d2cd743bc3416bd464be6ec5d25cc3a19] # to [b9b1ce5d34a1ab22e4b681c059c9f97595a221bd] # # patch "tests/log_with_restriction/__driver__.lua" # from [d7523060346d5f3f8fd2dbbadac938291eacae25] # to [e3954443c89014806e43c95cf27eae40774479da] # # patch "tests/manifest_restrictions/__driver__.lua" # from [3da1c4826eecb7e36b4ff378b0060850389e8b30] # to [1e1f2e48e9addbdbfa9397fa22a266b77fe537ed] # # patch "tests/merge_into_workspace/__driver__.lua" # from [eff4b2a9a9871f5086b302176397d983e6590c54] # to [f0d8a3f918161e863b03391afd5f41a40e64c626] # # patch "tests/merge_update_part_of_file/__driver__.lua" # from [565093b05d8d69d197845e84094eb3e8c9ae2da0] # to [95946167117984887df241fb213b85af451322b1] # # patch "tests/restricted_diff_bug/__driver__.lua" # from [e620f7cab9f6ae6cf8ff5d3d4a90bce1ec4d2bff] # to [a8ae9b8dedc79c3a1b996f840bbba25cb0945b30] # # patch "tests/restriction_includes_parent_dir/__driver__.lua" # from [ac9bfe2bc86af9d0fb04002bce621ba5d8309918] # to [391f80cff03c1a18d22d2add1d565c5f015e1902] # # patch "tests/restrictions_with_renames_and_adds/__driver__.lua" # from [6cfd296484ee2463c0bd86591f3736cdae49cc3f] # to [516ca2326af158f287fb7a588d5f97a77aad4c52] # # patch "tests/revert_file_to_base_revision/__driver__.lua" # from [a216dddc220abf1d3e0ecd727086283a1925b952] # to [2d55e59b2a7c7938e89182ad123dfd7aff537b4b] # # patch "tests/subdirectory_restrictions/__driver__.lua" # from [1e4ce8ba438a4d1fd2e5725bb77d51bd44b5f28f] # to [d40101e06f5b608f1252e979ef45bcecd7d9a2af] # # patch "tests/use_restrictions_with_--exclude/__driver__.lua" # from [698e0a979cecdb9e8b9b218bb31aef02d35f1329] # to [a365a49ccb3f3ff2e26257ffdc64ca3b99c0ad7c] # ============================================================ --- tests/automate_inventory_options/expected-renames-target-no-unchanged.stdout fc960c1c87ed1111a6dd8dee9a5e9423aaf28c78 +++ tests/automate_inventory_options/expected-renames-target-no-unchanged.stdout fc960c1c87ed1111a6dd8dee9a5e9423aaf28c78 @@ -0,0 +1,49 @@ + path "target" +new_type "directory" +old_path "source" + fs_type "directory" + birth [cb271687054afd3c2b873c8994f206f08fb240d3] + status "rename_target" "known" + + path "target/added" +new_type "file" + fs_type "file" + status "added" "known" + changes "content" + + path "target/ignored_1" +fs_type "file" + status "ignored" + + path "target/missing" +new_type "file" +old_path "source/missing" + fs_type "none" + birth [cb271687054afd3c2b873c8994f206f08fb240d3] + status "rename_target" "missing" + + path "target/rename_target" +new_type "file" +old_path "source/rename_source" + fs_type "file" + birth [cb271687054afd3c2b873c8994f206f08fb240d3] + status "rename_target" "known" + + path "target/source_1" +new_type "file" +old_path "source/source_1" + fs_type "file" + birth [cb271687054afd3c2b873c8994f206f08fb240d3] + status "rename_target" "known" + + path "target/source_2" +new_type "file" +old_path "source/source_2" + fs_type "file" + birth [cb271687054afd3c2b873c8994f206f08fb240d3] + status "rename_target" "known" + changes "content" + + path "target/unknown_1" +fs_type "file" + status "unknown" ============================================================ --- tests/automate_inventory_ignore_dirs/expected.stderr 8d34d463808ddf9b868d0e415a571ff18002388b +++ tests/automate_inventory_ignore_dirs/expected.stderr c8c0d4ace900124f27930a2cda3a36bae788a7d6 @@ -1,3 +1,4 @@ +mtn: warning: including missing parent '' ignore_file: 'emptyhomedir': false ignore_file: 'keys': false ignore_file: 'source': false ============================================================ --- tests/automate_inventory_ignore_dirs/expected.stdout ee97eb075d7fb94084672c6867355bd72728d9ef +++ tests/automate_inventory_ignore_dirs/expected.stdout 7953c6c570505b936fbd359736a3f88f36d28c77 @@ -1,3 +1,8 @@ + path "" +new_type "directory" + fs_type "directory" + status "added" "known" + path "source" new_type "directory" fs_type "directory" ============================================================ --- tests/automate_inventory_ignore_dirs/expected_2.stderr 9937d25da7c3bd55a10ba16018fade6ee9562e92 +++ tests/automate_inventory_ignore_dirs/expected_2.stderr f3a33a7222dbad2cf409a5a085b89366600a1abf @@ -1,3 +1,4 @@ +mtn: warning: including missing parent '' ignore_file: 'emptyhomedir': false ignore_file: 'keys': false ignore_file: 'source': false ============================================================ --- tests/automate_inventory_ignore_dirs/expected_2.stdout cd896018adbe95b59dd286c8f78080bb99073af7 +++ tests/automate_inventory_ignore_dirs/expected_2.stdout 9d91c961f4f49cedf3469b3c7f5d12e4ed2bb672 @@ -1,3 +1,8 @@ + path "" +new_type "directory" + fs_type "directory" + status "added" "known" + path "source" new_type "directory" fs_type "directory" ============================================================ --- tests/automate_inventory_options/__driver__.lua f2bbe3b9ec462bc791f29419b1f88052bf6199d6 +++ tests/automate_inventory_options/__driver__.lua 3a0944057bf7a7bda8d5efb98a3769c130885996 @@ -17,6 +17,7 @@ check(get("expected-renames-target.stdou check(get("expected-renames-both.stdout")) check(get("expected-renames-source.stdout")) check(get("expected-renames-target.stdout")) +check(get("expected-renames-target-no-unchanged.stdout")) check(get("expected-renames-target-no-ignored.stdout")) check(get("expected-renames-target-no-unknown.stdout")) @@ -94,7 +95,7 @@ canonicalize("stdout") -- marked as changed check(mtn("automate", "inventory", "target", "--no-corresponding-renames", "--no-unchanged"), 0, true, false) canonicalize("stdout") -check(readfile("expected-renames-target.stdout") == readfile("stdout")) +check(readfile("expected-renames-target-no-unchanged.stdout") == readfile("stdout")) check(mtn("automate", "inventory", "target", "--no-corresponding-renames", "--no-ignored"), 0, true, false) canonicalize("stdout") ============================================================ --- tests/automate_inventory_options/expected-no-ignored.stdout 8d87531d633398ec074c79a1196ab3fe3461437c +++ tests/automate_inventory_options/expected-no-ignored.stdout e658e6d766eaea69fe250e183d2022bd4566ff87 @@ -1,3 +1,10 @@ + path "" +old_type "directory" +new_type "directory" + fs_type "directory" + birth [cb271687054afd3c2b873c8994f206f08fb240d3] + status "known" + path "source" old_type "directory" new_type "directory" ============================================================ --- tests/automate_inventory_options/expected-no-unknown.stdout 6f89120110a15a4979689a11d984037858245f60 +++ tests/automate_inventory_options/expected-no-unknown.stdout 1f4d4a2f5a6d76dba47188c9923af374e9f9190d @@ -1,3 +1,10 @@ + path "" +old_type "directory" +new_type "directory" + fs_type "directory" + birth [cb271687054afd3c2b873c8994f206f08fb240d3] + status "known" + path "source" old_type "directory" new_type "directory" ============================================================ --- tests/automate_inventory_options/expected-none.stdout 8b56b8744aa7c03ece83e8f947a989b7afa66ed1 +++ tests/automate_inventory_options/expected-none.stdout 2eb25238f0890aed450e7d48ed30cda0dfb43a79 @@ -1,3 +1,10 @@ + path "" +old_type "directory" +new_type "directory" + fs_type "directory" + birth [cb271687054afd3c2b873c8994f206f08fb240d3] + status "known" + path "source" old_type "directory" new_type "directory" ============================================================ --- tests/automate_inventory_options/expected-renames-both.stdout 30c148e193838a02d0e041f8befc0c7d6b29c646 +++ tests/automate_inventory_options/expected-renames-both.stdout 6b0e385e1cb8ad6765802174e98d6a50a9437d1e @@ -1,3 +1,10 @@ + path "" +old_type "directory" +new_type "directory" + fs_type "directory" + birth [cb271687054afd3c2b873c8994f206f08fb240d3] + status "known" + path "source" old_type "directory" new_path "target" ============================================================ --- tests/automate_inventory_options/expected-renames-source.stdout 98075ff38b8a5622ea05d4969880fa2be741bbf3 +++ tests/automate_inventory_options/expected-renames-source.stdout 339e4fb242f37a9c7238ec6c4fb4e5192ebb4910 @@ -1,3 +1,10 @@ + path "" +old_type "directory" +new_type "directory" + fs_type "directory" + birth [cb271687054afd3c2b873c8994f206f08fb240d3] + status "known" + path "source" old_type "directory" new_path "target" ============================================================ --- tests/automate_inventory_options/expected-renames-target-no-ignored.stdout 208a14ecc012d3880e47db2af06eef124f83ce1c +++ tests/automate_inventory_options/expected-renames-target-no-ignored.stdout b627a5322e81f77f02f057e937b168323330e519 @@ -1,3 +1,10 @@ + path "" +old_type "directory" +new_type "directory" + fs_type "directory" + birth [cb271687054afd3c2b873c8994f206f08fb240d3] + status "known" + path "target" new_type "directory" old_path "source" ============================================================ --- tests/automate_inventory_options/expected-renames-target-no-unknown.stdout ae4773015e235754db26b51ceab35cf5944e7a5e +++ tests/automate_inventory_options/expected-renames-target-no-unknown.stdout efc3652de86150f2a04889249f05392ac4b010d2 @@ -1,3 +1,10 @@ + path "" +old_type "directory" +new_type "directory" + fs_type "directory" + birth [cb271687054afd3c2b873c8994f206f08fb240d3] + status "known" + path "target" new_type "directory" old_path "source" ============================================================ --- tests/automate_inventory_options/expected-renames-target.stdout fc960c1c87ed1111a6dd8dee9a5e9423aaf28c78 +++ tests/automate_inventory_options/expected-renames-target.stdout 163fbd543b823a162d42fae2bad9ff5ef923f59e @@ -1,3 +1,10 @@ + path "" +old_type "directory" +new_type "directory" + fs_type "directory" + birth [cb271687054afd3c2b873c8994f206f08fb240d3] + status "known" + path "target" new_type "directory" old_path "source" ============================================================ --- tests/automate_inventory_restricted/__driver__.lua ffb529f5c0632466857eaa24848d39e1cc1577d6 +++ tests/automate_inventory_restricted/__driver__.lua e24990972a5fe7b2ac00d415f91e94a28d3cbf92 @@ -147,6 +147,14 @@ index = check_inventory (parsed, index, index = 1 index = check_inventory (parsed, index, +{ path = "", + old_type = "directory", + new_type = "directory", + fs_type = "directory", + birth = rev1, + status = {"known"}}) + +index = check_inventory (parsed, index, { path = "dir_a", old_type = "directory", new_type = "directory", @@ -174,6 +182,14 @@ index = check_inventory (parsed, index, index = 1 index = check_inventory (parsed, index, +{ path = "", + old_type = "directory", + new_type = "directory", + fs_type = "directory", + birth = rev1, + status = {"known"}}) + +index = check_inventory (parsed, index, { path = "dir_a", old_type = "directory", new_type = "directory", @@ -196,6 +212,14 @@ index = check_inventory (parsed, index, index = 1 index = check_inventory (parsed, index, +{ path = "", + old_type = "directory", + new_type = "directory", + fs_type = "directory", + birth = rev1, + status = {"known"}}) + +index = check_inventory (parsed, index, { path = "dir_b", old_type = "directory", new_type = "directory", @@ -231,6 +255,14 @@ index = check_inventory (parsed, index, index = 1 index = check_inventory (parsed, index, +{ path = "", + old_type = "directory", + new_type = "directory", + fs_type = "directory", + birth = rev1, + status = {"known"}}) + +index = check_inventory (parsed, index, { path = "dir_a", old_type = "directory", new_type = "directory", @@ -252,6 +284,14 @@ index = check_inventory (parsed, index, index = 1 index = check_inventory (parsed, index, +{ path = "", + old_type = "directory", + new_type = "directory", + fs_type = "directory", + birth = rev1, + status = {"known"}}) + +index = check_inventory (parsed, index, { path = "dir_b", old_type = "directory", new_type = "directory", @@ -405,6 +445,14 @@ index = check_inventory (parsed, index, index = 1 index = check_inventory (parsed, index, +{ path = "", + old_type = "directory", + new_type = "directory", + fs_type = "directory", + birth = rev1, + status = {"known"}}) + +index = check_inventory (parsed, index, { path = "dir_a", old_type = "directory", new_path = "dir_c", @@ -462,6 +510,14 @@ index = check_inventory (parsed, index, index = 1 index = check_inventory (parsed, index, +{ path = "", + old_type = "directory", + new_type = "directory", + fs_type = "directory", + birth = rev1, + status = {"known"}}) + +index = check_inventory (parsed, index, { path = "dir_a", old_type = "directory", new_path = "dir_c", ============================================================ --- tests/diff_against_empty_file/__driver__.lua 5ce91b780f24a07fa350b5123c3a8f408f2e7061 +++ tests/diff_against_empty_file/__driver__.lua 694232efef6d74dc0bd435e5108d2f8e474c8415 @@ -7,7 +7,7 @@ writefile("foo") rename("foo", "foo.away") writefile("foo") -check(mtn("diff", "foo"), 0, true) +check(mtn("diff", "foo"), 0, true, false) canonicalize("stdout") rename("stdout", "monodiff") ============================================================ --- tests/diff_on_missing_trailing_newline_at_end_of_file/__driver__.lua 6075a66de87b656791ec862445c54a922a789eaa +++ tests/diff_on_missing_trailing_newline_at_end_of_file/__driver__.lua 2a22c345e9f38c7d615dbf0d8f27b1a603c6be20 @@ -33,25 +33,25 @@ copy("file3", "file1") anc = base_revision() copy("file3", "file1") -check(mtn("diff", "file1"), 0, true) +check(mtn("diff", "file1"), 0, true, false) canonicalize("stdout") rename("stdout", "file13.mtn-diff") check(samefile("file13.mtn-diff", "file13.diff")) copy("file4", "file1") -check(mtn("diff", "file1"), 0, true) +check(mtn("diff", "file1"), 0, true, false) canonicalize("stdout") rename("stdout", "file14.mtn-diff") check(samefile("file14.mtn-diff", "file14.diff")) copy("file3", "file2") -check(mtn("diff", "file2"), 0, true) +check(mtn("diff", "file2"), 0, true, false) canonicalize("stdout") rename("stdout", "file23.mtn-diff") check(samefile("file23.mtn-diff", "file23.diff")) copy("file4", "file2") -check(mtn("diff", "file2"), 0, true) +check(mtn("diff", "file2"), 0, true, false) canonicalize("stdout") rename("stdout", "file24.mtn-diff") check(samefile("file24.mtn-diff", "file24.diff")) ============================================================ --- tests/diff_restriction_renamed_parent/__driver__.lua 5d5547bc3ffacc13fb27a3adc1a7414279149510 +++ tests/diff_restriction_renamed_parent/__driver__.lua b6153bce8014680b1d322c6899ad845c2f3f627d @@ -6,11 +6,11 @@ orig = base_revision() orig = base_revision() -- rename the parent -check(mtn("rename", "parent1", "parent2"), 0, true, true) +check(mtn("rename", "parent1", "parent2"), 0, false, false) commit() -- alter the file writefile("parent2/file1", "something else") commit() -xfail(mtn("diff", "-r", orig, "parent2/file1"), 0, true, true) +check(mtn("diff", "-r", orig, "parent2/file1"), 0, false, false) ============================================================ --- tests/fetching_nonexistent_entry_from_children_bug/__driver__.lua 4b82854d39018a121885571307a4747b79f0d6e0 +++ tests/fetching_nonexistent_entry_from_children_bug/__driver__.lua 002f11175ac82b1b41427efc3136d1388f444f97 @@ -23,5 +23,9 @@ check(mtn("rename", "foo", "baz/foo"), 0 -- a) the foo file is not changed -- b) we only restrict on bar -- c) we only restrict on baz -check(mtn("commit", "-m", "wow", "baz/foo"), 1, false, false) +-- this was previously the case because restricting to baz/foo would exclude +-- the rename of bar to baz and try to commit foo +-- when the parent of foo (baz) is implicitly included the commit succeeds +check(mtn("commit", "-m", "wow", "baz/foo"), 0, false, false) + ============================================================ --- tests/log_dir/__driver__.lua 8b1e8d2d2cd743bc3416bd464be6ec5d25cc3a19 +++ tests/log_dir/__driver__.lua b9b1ce5d34a1ab22e4b681c059c9f97595a221bd @@ -44,15 +44,15 @@ for n,x in pairs{[""] = {0,0,0,0,0,0,0} for n,x in pairs{[""] = {0,0,0,0,0,0,0}, ["."] = {0,0,0,0,0,0,0}, - dir1 = {1,0,1,0,0,1,1}, - dir2 = {1,1,0,0,1,0,0}} do + dir1 = {0,0,1,0,0,1,1}, + dir2 = {0,1,0,0,1,0,0}} do if n == "" then check(mtn("log", "--no-graph"), 0, true) else - check(mtn("log", "--no-graph", n), 0, true) + check(mtn("log", "--no-graph", n), 0, true, false) end for i,v in pairs(x) do L("Checking log of '", n, "' for revision ", i, "\n") - check((v == 0) == qgrep("^Revision: "..revs[i], "stdout")) + check((v == 0) == qgrep("^Revision: "..revs[i], "stdout"), 0, false, false) end end ============================================================ --- tests/log_with_restriction/__driver__.lua d7523060346d5f3f8fd2dbbadac938291eacae25 +++ tests/log_with_restriction/__driver__.lua e3954443c89014806e43c95cf27eae40774479da @@ -10,6 +10,7 @@ commit("testbranch") check(mtn("add", "."), 0, true, false) commit("testbranch") +rev_root = base_revision() check(mtn("add", "1"), 0, true, false) commit("testbranch") @@ -98,11 +99,14 @@ rename("stdout", "log") check(mtn("log", "--no-graph", "foo"), 0, true, false) rename("stdout", "log") +-- note that we also get the initial commit that created the project's root +-- directory here because it is implicitly included as the parent of foo + check(grep("^Revision:", "log"), 0, true, false) rename("stdout", "revs") -check(numlines("revs") == 3) +check(numlines("revs") == 4) +check(grep("^Revision: " .. rev_root, "log"), 0, true) check(grep("^Revision: " .. rev_foo1, "log"), 0, true) check(grep("^Revision: " .. rev_foo2, "log"), 0, true) check(grep("^Revision: " .. rev_foo3, "log"), 0, true) - ============================================================ --- tests/manifest_restrictions/__driver__.lua 3da1c4826eecb7e36b4ff378b0060850389e8b30 +++ tests/manifest_restrictions/__driver__.lua 1e1f2e48e9addbdbfa9397fa22a266b77fe537ed @@ -22,11 +22,8 @@ commit() commit() --- FIXME_RESTRICTIONS: the old code allows for --depth=N with no paths --- and adds the "." path so that depth is interpreted against the current --- included directory. this seems bad. how does --depth interact with --exclude? ---check(mtn("ls", "known", "--depth=0"), 0, true, false) ---check(not qgrep("fileX", "stdout")) +check(mtn("ls", "known", "--depth=0"), 0, true, false) +check(not qgrep("fileX", "stdout")) check(mtn("ls", "known", "--depth=1", ".") , 0, true, false) check(not qgrep("fileX", "stdout")) ============================================================ --- tests/merge_into_workspace/__driver__.lua eff4b2a9a9871f5086b302176397d983e6590c54 +++ tests/merge_into_workspace/__driver__.lua f0d8a3f918161e863b03391afd5f41a40e64c626 @@ -83,7 +83,7 @@ check(get("expected-log-left")) check(get("expected-log")) check(get("expected-log-left")) -check(mtn("log", "--no-graph", "testfile"), 0, true, nil) +check(mtn("log", "--no-graph", "testfile"), 0, true, false) canonicalize("stdout") check(samefile_ignore_dates("stdout", "expected-log")) ============================================================ --- tests/merge_update_part_of_file/__driver__.lua 565093b05d8d69d197845e84094eb3e8c9ae2da0 +++ tests/merge_update_part_of_file/__driver__.lua 95946167117984887df241fb213b85af451322b1 @@ -33,14 +33,14 @@ copy("twochanges", "testfile") revert_to(anc) copy("twochanges", "testfile") -check(mtn("diff", "testfile"), 0, true) +check(mtn("diff", "testfile"), 0, true, false) canonicalize("stdout") rename("stdout", "monodiff") check(samefile("monodiff", "before.diff")) check(mtn("update"), 0, false, true) -check(mtn("diff", "testfile"), 0, true) +check(mtn("diff", "testfile"), 0, true, false) canonicalize("stdout") rename("stdout", "monodiff") xfail(samefile("monodiff", "after.diff")) ============================================================ --- tests/restricted_diff_bug/__driver__.lua e620f7cab9f6ae6cf8ff5d3d4a90bce1ec4d2bff +++ tests/restricted_diff_bug/__driver__.lua a8ae9b8dedc79c3a1b996f840bbba25cb0945b30 @@ -48,5 +48,5 @@ check(mtn("diff"), 0, false, false) check(mtn("mv", "dir1", "dir2"), 0, false, false) writefile("dir2/test.txt", "boohoo") check(mtn("diff"), 0, false, false) -xfail(mtn("diff", "dir2/test.txt"), 0, false, false) +check(mtn("diff", "dir2/test.txt"), 0, false, false) ============================================================ --- tests/restriction_includes_parent_dir/__driver__.lua ac9bfe2bc86af9d0fb04002bce621ba5d8309918 +++ tests/restriction_includes_parent_dir/__driver__.lua 391f80cff03c1a18d22d2add1d565c5f015e1902 @@ -1,29 +1,74 @@ mtn_setup() mtn_setup() --- - restricting a new project excludes the root directory addition --- - restricting to things below a newly added directory excludes the directory --- - excluding added directories but including things they contain is bad --- --- we should issue a nice error indicating that such a restriction must --- be expanded to include the containing directories. --- we should also provide some way to include only these directories and not --- all of their contents. --- --- --depth=0 should probably mean "directory without contents" rather than --- "directory and all immediate children" +-- Restricting a new project to a single file excludes the root directory +-- addition. The new implicit include semantics cause the root directory to +-- be included as the required parent of the specified file. addfile("file", "file") -- exclude newly added root dir but include file below it -check(mtn("st", "file"), 1, false, false) +-- this will implicitly include the root dir +check(mtn("st", "file"), 0, true, true) +rename("stdout", "additions") +rename("stderr", "warnings") + +check(grep("added", "additions"), 0, true, false) +check(numlines("stdout") == 2) +check(grep("including missing parent", "warnings"), 0, true, false) +check(numlines("stdout") == 1) + commit() mkdir("foo") addfile("foo/bar", "foobar") +-- exclude newly added foo dir but include bar below it +-- this will implicitly include the new foo dir and the root dir --- exclude newly added foo dir but include bar below it -check(mtn("st", "foo/bar"), 1, false, false) +check(mtn("st", "foo/bar"), 0, true, true) +rename("stdout", "additions") +rename("stderr", "warnings") + +check(grep("added", "additions"), 0, true, false) +check(numlines("stdout") == 2) +check(grep("including missing parent", "warnings"), 0, true, false) +check(numlines("stdout") == 2) + +-- ensure that --depth=0 means "directory without contents" rather +-- than "directory and all immediate children" + +check(mtn("st", "--depth", "0"), 0, true, false) +check(qgrep("no changes", "stdout")) + +check(mtn("st", "--depth", "1"), 0, true, false) +check(qgrep("foo", "stdout")) +check(not qgrep("foo/bar", "stdout")) + +check(mtn("st", "--depth", "2"), 0, true, false) +check(qgrep("foo", "stdout")) +check(qgrep("foo/bar", "stdout")) + +-- ensure that --depth is relative to the current directory + +chdir("foo") +check(mtn("st", ".", "--depth", "0"), 0, true, false) +check(qgrep("foo", "stdout")) +check(not qgrep("foo/bar", "stdout")) + +check(mtn("st", ".", "--depth", "1"), 0, true, false) +check(qgrep("foo", "stdout")) +check(qgrep("foo/bar", "stdout")) + +-- ensure that --depth is relative to the specified directory + +chdir("..") +check(mtn("st", "foo", "--depth", "0"), 0, true, false) +check(qgrep("foo", "stdout")) +check(not qgrep("foo/bar", "stdout")) + +check(mtn("st", "foo", "--depth", "1"), 0, true, false) +check(qgrep("foo", "stdout")) +check(qgrep("foo/bar", "stdout")) ============================================================ --- tests/restrictions_with_renames_and_adds/__driver__.lua 6cfd296484ee2463c0bd86591f3736cdae49cc3f +++ tests/restrictions_with_renames_and_adds/__driver__.lua 516ca2326af158f287fb7a588d5f97a77aad4c52 @@ -38,9 +38,9 @@ addfile("testdir/newfile", "asdfasdf") check(mtn("mv", "testdir", "newdir"), 0, false, false) mkdir("testdir") addfile("testdir/newfile", "asdfasdf") --- these are nonsensical, and should error out gracefully -check(mtn("diff", "newdir", "testdir/newfile"), 1, false, false) -check(mtn("commit", "newdir", "testdir/newfile"), 1, false, false) +-- these were once nonsensical, but should now include their parents +check(mtn("diff", "newdir", "testdir/newfile"), 0, false, false) +check(mtn("commit", "-m", "foobar", "newdir", "testdir/newfile"), 0, false, false) -- or: rename A, then rename B under it, and use a restriction that includes -- only B ============================================================ --- tests/revert_file_to_base_revision/__driver__.lua a216dddc220abf1d3e0ecd727086283a1925b952 +++ tests/revert_file_to_base_revision/__driver__.lua 2d55e59b2a7c7938e89182ad123dfd7aff537b4b @@ -108,12 +108,12 @@ check(qgrep("foofile2", "stdout")) check(qgrep("foofile0", "stdout")) check(qgrep("foofile2", "stdout")) -check(mtn("revert", "sub/foofile2"), 0, true) +check(mtn("revert", "sub/foofile2"), 0, true, false) check(mtn("status"), 0, true) check(qgrep("foofile0", "stdout")) check(not qgrep("foofile2", "stdout")) -check(mtn("revert", "foofile0"), 0, true) +check(mtn("revert", "foofile0"), 0, true, false) check(mtn("status"), 0, true) check(not qgrep("foofile0", "stdout")) check(not qgrep("foofile2", "stdout")) ============================================================ --- tests/subdirectory_restrictions/__driver__.lua 1e4ce8ba438a4d1fd2e5725bb77d51bd44b5f28f +++ tests/subdirectory_restrictions/__driver__.lua d40101e06f5b608f1252e979ef45bcecd7d9a2af @@ -33,7 +33,7 @@ check(qgrep("bar/bar", "stdout")) check(qgrep("foo/foo", "stdout")) check(qgrep("bar/bar", "stdout")) -check(mtn("--norc", "status", "."), 0, true) +check(mtn("--norc", "status", "."), 0, true, false) check(qgrep("foo/foo", "stdout")) check(not qgrep("bar/bar", "stdout")) @@ -47,7 +47,7 @@ check(qgrep("bar/bar", "stdout")) check(qgrep("foo/foo", "stdout")) check(qgrep("bar/bar", "stdout")) -check(mtn("--norc", "status", "."), 0, true) +check(mtn("--norc", "status", "."), 0, true, false) check(not qgrep("foo/foo", "stdout")) check(qgrep("bar/bar", "stdout")) ============================================================ --- tests/use_restrictions_with_--exclude/__driver__.lua 698e0a979cecdb9e8b9b218bb31aef02d35f1329 +++ tests/use_restrictions_with_--exclude/__driver__.lua a365a49ccb3f3ff2e26257ffdc64ca3b99c0ad7c @@ -15,12 +15,18 @@ check(mtn("ci", "--exclude", ".", "-m", -- the root dir has not been created and excluding the whole tree -- excludes this creation. this causes the commit to fail because -- file1 has no parent. --- --- check(MTN ci --exclude . file1 -m 'x', 0, false, false) --- check(MTN status --brief | grep "foo/bar", 0, false, false) --- check(MTN status --brief | grep "file1", 1, false, false) --- check(echo a >>file1) +-- implicitly including all parents of explicitly included nodes +-- fixes this problem but will include changes to the parent nodes + +-- explicit exclude and implicit include of "." + +check(mtn("ci", "--exclude", ".", "file1", "-m", "x"), 0, false, false) +check(mtn("status"), 0, true, false) +check(qgrep("foo/bar", "stdout")) +check(not qgrep("file1", "stdout")) +append("file1", "a") + check(mtn("ci", "--exclude", "foo", "-m", 'x'), 0, false, false) check(mtn("status"), 0, true) check(qgrep("foo/bar", "stdout")) @@ -33,6 +39,8 @@ append("foo/bar", "b") check(qgrep("file1", "stdout")) append("foo/bar", "b") +-- explicit exclude and implicit include of foo + check(mtn("ci", ".", "--exclude", "foo", "foo/bar", "-m", 'x'), 0, false, false) check(mtn("status"), 0, true) check(not qgrep("foo/bar", "stdout"))