# # # patch "tests/diff_restriction_renamed_parent/__driver__.lua" # from [1fa2ff717d0eaba01be5536b296d3ad1eeafd3a9] # to [a73b057bb0c215fe9fddad073b21cb398db9e84e] # # patch "tests/diff_shows_renames/__driver__.lua" # from [aac530fcf51c3773c72bb5f7071f60fc04cf1e57] # to [b62260ad2251ab290a487bcf3cc8f35da5f14000] # # patch "tests/diffing_a_revision_with_an_added_file/__driver__.lua" # from [66955d5af876eae94d642151a03921996efd25ef] # to [9fa4fc7b7a8e66987e8e96bcdd515bbf8e480d9f] # # patch "tests/log_--diffs/__driver__.lua" # from [feaf32209db7e57b3520c6d3f7dfde930ef76383] # to [734a972fa91ab98e63bf4c456e24653cfb5a258c] # # patch "tests/log_--diffs/expect_restrict" # from [8c333bf33df8074f758eb4db896641486d44062a] # to [80408e201c7d27941a2848f14e2fc8118818af6b] # # patch "tests/restricted_diff_bug/__driver__.lua" # from [de373f96e3ff7816b0b73f5adc34eead19b4511c] # to [2ca633339078f156e33cb3e8cb1a5b650311fee4] # ============================================================ --- tests/diff_restriction_renamed_parent/__driver__.lua 1fa2ff717d0eaba01be5536b296d3ad1eeafd3a9 +++ tests/diff_restriction_renamed_parent/__driver__.lua a73b057bb0c215fe9fddad073b21cb398db9e84e @@ -13,5 +13,20 @@ commit() writefile("parent2/file1", "something else") commit() --- fixme +check(mtn("diff", "-r", orig), 0, true, false) +check(qgrep("^--- parent1/file1\t", "stdout")) +check(qgrep("^\\+\\+\\+ parent2/file1\t", "stdout")) + +check(mtn("diff", "-r", orig, "parent2"), 0, true, false) +check(qgrep("^--- parent1/file1\t", "stdout")) +check(qgrep("^\\+\\+\\+ parent2/file1\t", "stdout")) + +-- this fails because restricting to parent2/file1 excludes the rename +-- of parent1 to parent2 and when diff goes to get the file content +-- for file1 it looks in parent1/file1 rather than parent2/file1 + +-- the solution here is probably to make the restrictions code implicitly +-- include the parents, non-recursively, of all explicitly included nodes +-- then the parent rename would be included here and the diff would work. + xfail(mtn("diff", "-r", orig, "parent2/file1"), 0, true, true) ============================================================ --- tests/diff_shows_renames/__driver__.lua aac530fcf51c3773c72bb5f7071f60fc04cf1e57 +++ tests/diff_shows_renames/__driver__.lua b62260ad2251ab290a487bcf3cc8f35da5f14000 @@ -11,15 +11,10 @@ check(qgrep("^\\+\\+\\+ foo/newbar\t", " check(qgrep("^--- foo/bar\t", "stdout")) check(qgrep("^\\+\\+\\+ foo/newbar\t", "stdout")) --- The bug here is that the diff code tries to infer renames from the csets --- involved. It should just use the pre- and post-roster to get the pre- and --- post-name. - remove("foo") revert_to(root_rev) check(mtn("mv", "foo", "newfoo"), 0, false, false) writefile("newfoo/bar", "version 2!\n") check(mtn("diff"), 0, true, false) --- fixme -xfail(qgrep("^--- foo/bar\t", "stdout")) +check(qgrep("^--- foo/bar\t", "stdout")) check(qgrep("^\\+\\+\\+ newfoo/bar\t", "stdout")) ============================================================ --- tests/diffing_a_revision_with_an_added_file/__driver__.lua 66955d5af876eae94d642151a03921996efd25ef +++ tests/diffing_a_revision_with_an_added_file/__driver__.lua 9fa4fc7b7a8e66987e8e96bcdd515bbf8e480d9f @@ -6,7 +6,9 @@ addfile("foo2", "foo file 2") parent = base_revision() addfile("foo2", "foo file 2") +id2=sha1("foo2") commit() -check(mtn("diff", "--revision", parent, "--revision", base_revision()), 0, false, false) --- fixme assert something!?! +check(mtn("diff", "--revision", parent, "--revision", base_revision()), 0, true, false) +check(qgrep("^--- /dev/null\t$", "stdout")) +check(qgrep("^\\+\\+\\+ foo2\t" .. id2 .. "$", "stdout")) ============================================================ --- tests/log_--diffs/__driver__.lua feaf32209db7e57b3520c6d3f7dfde930ef76383 +++ tests/log_--diffs/__driver__.lua 734a972fa91ab98e63bf4c456e24653cfb5a258c @@ -34,9 +34,18 @@ check(samefile("expect_full", "full")) check(samefile("expect_full", "full")) -- restrict to foo2 and quux -check(mtn("log", "--no-graph", "", "quux", "foo2", "--depth", "0", "--diffs"), 0, true, false) +check(mtn("log", "--no-graph", "quux", "foo2", "--diffs", "--from", REV4, "--to", REV1), 0, true, false) check(grep("^(---|\\+\\+\\+) ", "stdout"), 0, true, false) rename("stdout", "restrict") check(get("expect_restrict")) canonicalize("restrict") check(samefile("expect_restrict", "restrict")) + +-- this fails because restricting to quux and foo2 excludes the +-- addition of the root dir in the initial revision. + +-- the solution here is probably to make the restrictions code implicitly +-- include the parents, non-recursively, of all explicitly included nodes +-- then the parent rename would be included here and the diff would work. + +xfail(mtn("log", "-r", REV1, "quux", "foo2", "--diffs"), 0, false, false) ============================================================ --- tests/log_--diffs/expect_restrict 8c333bf33df8074f758eb4db896641486d44062a +++ tests/log_--diffs/expect_restrict 80408e201c7d27941a2848f14e2fc8118818af6b @@ -4,5 +4,3 @@ +++ quux f3d9ae4aeea6946a8668445395ba10b7399523a0 --- foo f1d2d2f924e986ac86fdf7b36c94bcdf32beec15 +++ foo 5527e63e7193ef5fadbc8fd40cc8092d742602e7 ---- /dev/null -+++ foo f1d2d2f924e986ac86fdf7b36c94bcdf32beec15 ============================================================ --- tests/restricted_diff_bug/__driver__.lua de373f96e3ff7816b0b73f5adc34eead19b4511c +++ tests/restricted_diff_bug/__driver__.lua 2ca633339078f156e33cb3e8cb1a5b650311fee4 @@ -41,6 +41,14 @@ mtn_setup() -- -- so it looks like the restricted cset is bad. +-- actually, the restriction excludes the parent dir rename and because of this +-- diff uses the old name to try and get the file content, which no longer +-- available under that name. + +-- the solution here is probably to make the restrictions code implicitly +-- include the parents, non-recursively, of all explicitly included nodes +-- then the parent rename would be included here and the diff would work. + mkdir("dir1") addfile("dir1/test.txt", "booya") commit() @@ -48,5 +56,4 @@ 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) --- fixme xfail(mtn("diff", "dir2/test.txt"), 0, false, false)