# # # add_dir "tests/revert_directory_blocked_by_unversioned_directory" # # add_dir "tests/revert_directory_blocked_by_unversioned_file" # # add_dir "tests/revert_directory_replaced_by_file" # # add_dir "tests/revert_file_blocked_by_unversioned_file" # # add_dir "tests/revert_file_replaced_by_directory" # # add_dir "tests/revert_renamed_directory_replaced_by_file" # # add_dir "tests/revert_renamed_file_replaced_by_directory" # # add_dir "tests/revert_uncommitted_execute_attr" # # add_file "tests/revert_directory_blocked_by_unversioned_directory/__driver__.lua" # content [94c688b062bf3b84507a7875e8698b51c5279a97] # # add_file "tests/revert_directory_blocked_by_unversioned_file/__driver__.lua" # content [460b12cf6664ac9b34fab599ae9ab26a0a891901] # # add_file "tests/revert_directory_replaced_by_file/__driver__.lua" # content [13dbdb6c52283040a1045c7d99b074e380e13f57] # # add_file "tests/revert_file_blocked_by_unversioned_file/__driver__.lua" # content [4f01e34164adfa752a25985903688ca9bc273443] # # add_file "tests/revert_file_replaced_by_directory/__driver__.lua" # content [e04e415edef74eef7cd155cb09d23d4961e18c42] # # add_file "tests/revert_renamed_directory_replaced_by_file/__driver__.lua" # content [1f6192a0a13133b95d30a2cb0af20da40d2075be] # # add_file "tests/revert_renamed_file_replaced_by_directory/__driver__.lua" # content [3f022d1ae28ab28197c14b5cbcac2926054a02f2] # # add_file "tests/revert_uncommitted_execute_attr/__driver__.lua" # content [e56a09311529b258b78947c3c0b64029d5e3c034] # # patch "tests/revert_attrs/__driver__.lua" # from [ba6ed36f84bd482570b8e5ca8b03041663f83e1a] # to [14ae08589ade10bb0f413906dbbcb555a71a598f] # # patch "tests/revert_file_blocked_by_unversioned_directory/__driver__.lua" # from [c85d6f7894b2834e9ef56a32c89d792255fa9321] # to [b3ac1be852e79e12313991fb8c6cfe990dc015ec] # # patch "tests/revert_the_middle_of_a_sequence/__driver__.lua" # from [38fd09afc38afbee8acfc700507186a9c1fbf007] # to [4c778d159b2e7555bf541535d53d99ca7f58c1da] # ============================================================ --- tests/revert_directory_blocked_by_unversioned_directory/__driver__.lua 94c688b062bf3b84507a7875e8698b51c5279a97 +++ tests/revert_directory_blocked_by_unversioned_directory/__driver__.lua 94c688b062bf3b84507a7875e8698b51c5279a97 @@ -0,0 +1,19 @@ +mtn_setup() + +-- reverting a renamed directory that has been replaced by an unversioned directory +-- under the original name should recreate the original directory and remove the +-- previously renamed copy + +mkdir("foo") +check(mtn("add", "foo"), 0, false, false) + +commit() + +check(mtn("mv", "foo", "bar"), 0, false, false) + +-- create an unversioned directory foo blocking the revert of the renamed foo +mkdir("foo") + +check(mtn("revert", "."), 0, false, false) + +xfail_if(exists("bar")) ============================================================ --- tests/revert_directory_blocked_by_unversioned_file/__driver__.lua 460b12cf6664ac9b34fab599ae9ab26a0a891901 +++ tests/revert_directory_blocked_by_unversioned_file/__driver__.lua 460b12cf6664ac9b34fab599ae9ab26a0a891901 @@ -0,0 +1,19 @@ +mtn_setup() + +-- reverting a renamed directory that has been replaced by an unversioned file +-- should remove the unversioned file, recreate the original directory and +-- remove the renamed directory + +mkdir("foo") +check(mtn("add", "foo"), 0, false, false) + +commit() + +check(mtn("mv", "foo", "bar"), 0, false, false) + +-- create file blocking revert of foo +writefile("foo", "foo") + +xfail(mtn("revert", "."), 0, false, false) + +xfail_if(exists("bar")) ============================================================ --- tests/revert_directory_replaced_by_file/__driver__.lua 13dbdb6c52283040a1045c7d99b074e380e13f57 +++ tests/revert_directory_replaced_by_file/__driver__.lua 13dbdb6c52283040a1045c7d99b074e380e13f57 @@ -0,0 +1,15 @@ +mtn_setup() + +-- reverting a directory that has been replaced by a file should remove the +-- file and recreate the directory + +mkdir("foo") +check(mtn("add", "foo"), 0, false, false) + +commit() + +-- replace foo with a file +remove("foo") +writefile("foo", "foo") + +xfail(mtn("revert", "."), 0, false, false) ============================================================ --- tests/revert_file_blocked_by_unversioned_file/__driver__.lua 4f01e34164adfa752a25985903688ca9bc273443 +++ tests/revert_file_blocked_by_unversioned_file/__driver__.lua 4f01e34164adfa752a25985903688ca9bc273443 @@ -0,0 +1,18 @@ +mtn_setup() + +-- reverting a renamed file that has been replaced by an unversioned file +-- under the original name should recreate the original file and remove the +-- previously renamed copy + +addfile("foo", "foo") + +commit() + +check(mtn("mv", "foo", "bar"), 0, false, false) + +-- create an unversioned file foo blocking the revert of the renamed foo +writefile("foo", "unversioned") + +check(mtn("revert", "."), 0, false, false) + +xfail_if(exists("bar")) ============================================================ --- tests/revert_file_replaced_by_directory/__driver__.lua e04e415edef74eef7cd155cb09d23d4961e18c42 +++ tests/revert_file_replaced_by_directory/__driver__.lua e04e415edef74eef7cd155cb09d23d4961e18c42 @@ -0,0 +1,14 @@ +mtn_setup() + +-- reverting a file that has been replaced by a directory should remove the +-- directory and recreate the file + +addfile("foo", "foo") + +commit() + +-- replace foo with a directory +remove("foo") +mkdir("foo") + +xfail(mtn("revert", "."), 0, false, false) ============================================================ --- tests/revert_renamed_directory_replaced_by_file/__driver__.lua 1f6192a0a13133b95d30a2cb0af20da40d2075be +++ tests/revert_renamed_directory_replaced_by_file/__driver__.lua 1f6192a0a13133b95d30a2cb0af20da40d2075be @@ -0,0 +1,19 @@ +mtn_setup() + +-- reverting a renamed directory that has been replaced by a file should +-- recreate the directory and remove the file + +mkdir("foo") +check(mtn("add", "foo"), 0, false, false) + +commit() + +check(mtn("mv", "foo", "bar"), 0, false, false) + +-- replace bar with a file +remove("bar") +writefile("bar", "bar") + +check(mtn("revert", "."), 0, false, false) + +xfail_if(exists("bar")) ============================================================ --- tests/revert_renamed_file_replaced_by_directory/__driver__.lua 3f022d1ae28ab28197c14b5cbcac2926054a02f2 +++ tests/revert_renamed_file_replaced_by_directory/__driver__.lua 3f022d1ae28ab28197c14b5cbcac2926054a02f2 @@ -0,0 +1,18 @@ +mtn_setup() + +-- reverting a renamed file that has been replaced by a directory should +-- recreate the file and remove the directory + +addfile("foo", "foo") + +commit() + +check(mtn("mv", "foo", "bar"), 0, false, false) + +-- replace bar with a directory +remove("bar") +mkdir("bar") + +check(mtn("revert", "."), 0, false, false) + +xfail_if(exists("bar")) ============================================================ --- tests/revert_uncommitted_execute_attr/__driver__.lua e56a09311529b258b78947c3c0b64029d5e3c034 +++ tests/revert_uncommitted_execute_attr/__driver__.lua e56a09311529b258b78947c3c0b64029d5e3c034 @@ -0,0 +1,16 @@ +skip_if(ostype=="Windows") +skip_if(not existsonpath("chmod")) + +mtn_setup() + +writefile("foo", "some data") + +check(mtn("add", "foo"), 0, false, false) +check(mtn("attr", "set", "foo", "mtn:execute", "true"), 0, false, false) + +-- setting the execute attr should set execute permission +check({"test", "-x","foo"}, 0, false, false) + +-- revert the execute attr should clear execute permissions +check(mtn("revert", "foo"), 0, false, false) +xfail({"test", "!", "-x","foo"}, 0, false, false) ============================================================ --- tests/revert_attrs/__driver__.lua ba6ed36f84bd482570b8e5ca8b03041663f83e1a +++ tests/revert_attrs/__driver__.lua 14ae08589ade10bb0f413906dbbcb555a71a598f @@ -14,7 +14,7 @@ commit() commit() --- now flip the attributes so that for has a dormant mtn:execute +-- now flip the attributes so that foo has a dormant mtn:execute check(mtn("attr", "drop", "foo", "mtn:execute"), 0, false, false) check(mtn("attr", "set", "bar", "mtn:execute", "true"), 0, false, false) ============================================================ --- tests/revert_file_blocked_by_unversioned_directory/__driver__.lua c85d6f7894b2834e9ef56a32c89d792255fa9321 +++ tests/revert_file_blocked_by_unversioned_directory/__driver__.lua b3ac1be852e79e12313991fb8c6cfe990dc015ec @@ -1,12 +1,8 @@ - mtn_setup() --- this test is a bug report --- --- reverting a file that has been replaced by a (non-versioned) directory --- should do something sensible. I'm not sure what that is though. --- this is almost a working copy conflict but it seems silly that revert --- would ever encounter a conflict. +-- reverting a renamed file that has been replaced by an unversioned directory +-- should remove the unversioned directory, recreate the original file and +-- remove the renamed file addfile("foo", "foo") @@ -17,4 +13,6 @@ mkdir("foo") -- create directory blocking revert of foo mkdir("foo") -xfail_if(true, mtn("revert", "."), 0, false, false) +xfail(mtn("revert", "."), 0, false, false) + +xfail_if(exists("bar")) ============================================================ --- tests/revert_the_middle_of_a_sequence/__driver__.lua 38fd09afc38afbee8acfc700507186a9c1fbf007 +++ tests/revert_the_middle_of_a_sequence/__driver__.lua 4c778d159b2e7555bf541535d53d99ca7f58c1da @@ -9,6 +9,12 @@ addfile("file1", "new file1") -- first check; revert the new file which will end up reverting both changes -- XXX is this really desired behaviour? + +-- currently each name is matched against both workspace rosters. here "file1" +-- from the old roster has been renamed to "file2" in the new roster and "file1" +-- has also been added to the new roster. given these two rosters the name "file1" +-- identifies two different files. + check(mtn("revert", "file1"), 0, true, true) -- check results @@ -17,4 +23,6 @@ addfile("file1", "new file1") addfile("file1", "new file1") -- second check; revert the renamed file which will.. uh.. trip an I() +-- this should fail because we would otherwise have two file1's +-- but it should fail more gracefully than with an I() xfail(check(mtn("revert", "file3"), 3, true, true))