# # # add_dir "tests/pluck_restricted" # # add_file "tests/pluck_restricted/__driver__.lua" # content [ba192bc4981a40610ac4914a7eea58527bed66d9] # # patch "ChangeLog" # from [0cffe0da4b27cfcf1e6edc26647609fedc1f055b] # to [616c245fe5ff551f6d76b33eee8cc82b752518ba] # # patch "cmd_merging.cc" # from [1ddeea2f8c738677ecb9a3e256e215b1822416be] # to [aac57b6436dec206d4c167d0ecae2d24a6a1fb50] # # patch "testsuite.lua" # from [b73b21df2b53fe0f868d462de1e8ead6672b9561] # to [43bf94ebb89497ee35438d70e56316e0b0867685] # ============================================================ --- tests/pluck_restricted/__driver__.lua ba192bc4981a40610ac4914a7eea58527bed66d9 +++ tests/pluck_restricted/__driver__.lua ba192bc4981a40610ac4914a7eea58527bed66d9 @@ -0,0 +1,34 @@ +mtn_setup() + +function C(str) + return (string.gsub(str, "(.)", "%1\n")) +end + +addfile("testfile", C("abc")) +addfile("otherfile", C("123")) +commit() +root_rev = base_revision() + +writefile("testfile", C("1bc")) +writefile("otherfile", C("a23")) +commit() +first_rev = base_revision() + +writefile("testfile", C("1b3")) +writefile("otherfile", C("a2c")) +commit() +second_rev = base_revision() + +revert_to(root_rev) +check(readfile("testfile") == C("abc")) +check(readfile("otherfile") == C("123")) +check(mtn("pluck", "-r", second_rev, "testfile"), 0, false, false) +check(readfile("testfile") == C("ab3")) +check(readfile("otherfile") == C("123")) + +revert_to(root_rev) +check(readfile("testfile") == C("abc")) +check(readfile("otherfile") == C("123")) +check(mtn("pluck", "-r", second_rev, "--exclude", "testfile"), 0, false, false) +check(readfile("testfile") == C("abc")) +check(readfile("otherfile") == C("12c")) ============================================================ --- ChangeLog 0cffe0da4b27cfcf1e6edc26647609fedc1f055b +++ ChangeLog 616c245fe5ff551f6d76b33eee8cc82b752518ba @@ -1,5 +1,10 @@ 2006-07-09 Nathaniel Smith
+ * cmd_merging.cc (pluck): Restrictions support. + * tests/pluck_restricted/__driver__.lua: New test. + +2006-07-09 Nathaniel Smith + * roster.cc (check_sane_against): Take a temp_nodes_ok arg. (mark_roster_with_one_parent): Pass it. ============================================================ --- cmd_merging.cc 1ddeea2f8c738677ecb9a3e256e215b1822416be +++ cmd_merging.cc aac57b6436dec206d4c167d0ecae2d24a6a1fb50 @@ -608,7 +608,7 @@ % result.directory_loop_conflicts.size()); } -CMD(pluck, N_("workspace"), N_("[-r FROM] -r TO"), +CMD(pluck, N_("workspace"), N_("[-r FROM] -r TO [PATH...]"), N_("Apply changes made at arbitrary places in history to current workspace.\n" "This command takes changes made at any point in history, and\n" "edits your current workspace to include those changes. The end result\n" @@ -621,11 +621,8 @@ "\n" "If two revisions are given, applies the changes made to get from the\n" "first revision to the second."), - OPT_REVISION) + OPT_REVISION % OPT_DEPTH % OPT_EXCLUDE) { - if (args.size() > 0) - throw usage(name); - // Work out our arguments revision_id from_rid, to_rid; @@ -689,7 +686,7 @@ // The node id source we'll use for the 'working' and 'to' rosters. temp_node_id_source nis; - // Get the FROM roster and markings + // Get the FROM roster shared_ptr