# # # rename "tests/restrictions_bug" # to "tests/restricted_diff_bug" # # add_dir "tests/restricted_revert_bug" # # add_file "tests/restricted_revert_bug/__driver__.lua" # content [55cc8ce4d2b0051d240f2e8d02d32ed3500cf408] # # patch "tests/restricted_diff_bug/__driver__.lua" # from [f6f94176fbab56ddde3f413cb5f9c0a63a87037b] # to [a647180dc43752bed9e934c8aaa9eae8d3003b91] # ============================================================ --- tests/restricted_revert_bug/__driver__.lua 55cc8ce4d2b0051d240f2e8d02d32ed3500cf408 +++ tests/restricted_revert_bug/__driver__.lua 55cc8ce4d2b0051d240f2e8d02d32ed3500cf408 @@ -0,0 +1,23 @@ +mtn_setup() + +-- this bug appears to be related to tests/restricted_diff_bug + +mkdir("dir1") +addfile("dir1/test.txt", "booya") +commit() + +original=sha1("dir1/test.txt") + +check(mtn("mv", "dir1", "dir2"), 0, false, false) +writefile("dir2/test.txt", "boohoo") + +-- presumably this should only revert the content of test.txt +-- because it only includes that node +-- note that it is the parents name that has changed + +check(mtn("revert", "dir2/test.txt"), 0, false, false) + +reverted=sha1("dir2/test.txt") +xfail(original == reverted) + + ============================================================ --- tests/restricted_diff_bug/__driver__.lua f6f94176fbab56ddde3f413cb5f9c0a63a87037b +++ tests/restricted_diff_bug/__driver__.lua a647180dc43752bed9e934c8aaa9eae8d3003b91 @@ -14,6 +14,32 @@ mtn_setup() -- -- Note also that running "mtn diff" with no path -- argument works fine. +-- +-- The problem here is that when diff is restricted +-- to "dir2/test.txt" (node 3) the roster does not *have* +-- anything called "dir2" because that rename has been +-- excluded. The file is still called "dir1/test.txt" under +-- the restriction. This is rather odd, since we restricted +-- it using the name "dir2/test.txt" which is valid under +-- the full post-state roster. The bad name exists in +-- the restricted cset and faults in check_restricted_cset. +-- +-- the original roster contains +-- node 1 (root) +-- node 2 (dir2) +-- node 3 (test.txt) +-- +-- the restricted roster contains +-- node 1 (root) +-- node 2 (dir1) +-- node 3 (test.txt) +-- +-- the restricted cset contains +-- patch "dir2/test.txt" +-- from [...] +-- to [...] +-- +-- so it looks like the restricted cset is bad. mkdir("dir1") addfile("dir1/test.txt", "booya")