# # # patch "ChangeLog" # from [9201a20f06e7485e50b7f2355c57ca3b8e46fda5] # to [d557b3630fb9b1ff2f016dba4e593e38a9c0720a] # # patch "cmd_merging.cc" # from [53b98e970d76db48b171fdcee4450b54dcc7bde0] # to [3a6300b1c7050f924b9953951d89459512bd8e95] # # patch "tests/pluck_basics/__driver__.lua" # from [1c8172760fd4da3eb1f8b5b10132ee0ff2b75426] # to [9379aaadf1a3df8333535db2c08f969421ff3d84] # ============================================================ --- ChangeLog 9201a20f06e7485e50b7f2355c57ca3b8e46fda5 +++ ChangeLog d557b3630fb9b1ff2f016dba4e593e38a9c0720a @@ -1,3 +1,9 @@ +2006-07-06 Nathaniel Smith + + * cmd_merging.cc (pluck): Write a note to _MTN/log after each + pluck. + * tests/pluck_basics/__driver__.lua: Test for it. + 2006-07-05 Nathaniel Smith * tests/checking_a_few_command_specific_options/__driver__.lua ============================================================ --- cmd_merging.cc 53b98e970d76db48b171fdcee4450b54dcc7bde0 +++ cmd_merging.cc 3a6300b1c7050f924b9953951d89459512bd8e95 @@ -636,7 +636,7 @@ N(parents.size() == 1, F("revision %s is a merge\n" "to apply the changes relative to one of its parents, use:\n" - " %s cherrypatch -r PARENT -r %s") + " %s pluck -r PARENT -r %s") % to_rid % app.prog_name % to_rid); from_rid = *parents.begin(); @@ -660,10 +660,10 @@ // V V // to --> merged // - // - from is the revision we start cherrypatching from - // - to is the revision we stop cherrypatching at + // - from is the revision we start plucking from + // - to is the revision we stop plucking at // - working is the current contents of the workspace - // - merged is the result of the cherrypatching, and achieved by running a + // - merged is the result of the plucking, and achieved by running a // merge in the fictional graph seen above // // finally, we take the cset from working -> merged, and apply that to the @@ -764,6 +764,19 @@ put_work_cset(remaining); update_any_attrs(app); maybe_update_inodeprints(app); + + // add a note to the user log file about what we did + { + data log; + read_user_log(log); + std::string log_str = log(); + if (!log_str.empty()) + log_str += "\n"; + log_str += (FL("applied changes from %s\n" + " through %s\n") + % from_rid % to_rid).str(); + write_user_log(data(log_str)); + } } CMD(heads, N_("tree"), "", N_("show unmerged head revisions of branch"), ============================================================ --- tests/pluck_basics/__driver__.lua 1c8172760fd4da3eb1f8b5b10132ee0ff2b75426 +++ tests/pluck_basics/__driver__.lua 9379aaadf1a3df8333535db2c08f969421ff3d84 @@ -22,6 +22,8 @@ newtext = readfile("otherfile") check(newtext == "1\n2\n3-changed\n4\n5-changed\n") check(readfile("somefile") == "blah blah\n") +check(string.find(readfile("_MTN/log"), first_rev .. ".*" .. second_rev) ~= nil) +writefile("_MTN/log", "") check(mtn("pluck", "-r", second_rev, "-r", first_rev), 0, false, false) newtext = readfile("otherfile") @@ -30,9 +32,12 @@ -- transition deletes "somefile", because the identity link between these two -- files with the name "somefile" has been broken. check(exists("somefile")) +check(string.find(readfile("_MTN/log"), second_rev .. ".*" .. first_rev) ~= nil) +writefile("_MTN/log", "") -- should get a conflict on the two "somefile" adds check(mtn("pluck", "-r", root_rev, "-r", second_rev), 1, false, false) +check(readfile("_MTN/log") == "") check(mtn("drop", "-e", "somefile"), 0, false, false) -- now it should work again @@ -40,3 +45,5 @@ newtext = readfile("otherfile") check(newtext == "1-changed\n2\n3-changed\n4\n5-changed\n") check(readfile("somefile") == "blah blah\n") +check(string.find(readfile("_MTN/log"), root_rev .. ".*" .. second_rev) ~= nil) +writefile("_MTN/log", "")