diff --git a/src/commands/CmdMerge.cpp b/src/commands/CmdMerge.cpp index 0447cff14..72612f024 100644 --- a/src/commands/CmdMerge.cpp +++ b/src/commands/CmdMerge.cpp @@ -96,7 +96,21 @@ int CmdMerge::execute (std::string& output) if ( ((sAutopush == "ask") && (confirm ("Would you like to push the merged changes to \'" + uri._data + "\'?")) ) || (bAutopush) ) { - // TODO derive autopush uri from merge.default.uri? otherwise: change prompt above + // Derive autopush uri from merge.default.uri? otherwise: change prompt above + + // Change the "merge" command to "push". + std::vector ::iterator i; + for (i = context.a3.begin (); i != context.a3.end (); ++i) + { + if (i->_category == Arg::cat_command) + { + i->_raw = "push"; + break; + } + } + + // Append the URI argument. + context.a3.push_back (Arg (uri._data, Arg::cat_literal)); std::string out; context.commands["push"]->execute (out); diff --git a/test/merge.duplicates.t b/test/merge.duplicates.t index d8f98ee0d..59f9c1edf 100755 --- a/test/merge.duplicates.t +++ b/test/merge.duplicates.t @@ -143,11 +143,11 @@ unlike ($output, qr/Missing/, "no missing entry"); $output = qx{../src/task rc:3.rc merge}; like ($output, qr/Merge complete/, "res3: post-merge completed"); unlike ($output, qr/Missing/, "no missing entry"); -like ($output, qr/Retain/, "retained changes"); +like ($output, qr/Retain/, "retained changes"); # 16 # pre-merge 1st $output = qx{../src/task rc:1.rc merge}; -like ($output, qr/Merge complete/, "res1: pre-merge completed"); +like ($output, qr/Merge complete/, "res1: pre-merge completed"); # 17 unlike ($output, qr/Missing/, "no missing entry"); qx{../src/task rc:1.rc add Task5};