# # # patch "cmd_merging.cc" # from [6f7293c9f832b0a5ac5aa91e21164df2787381c3] # to [89b55863602631a158f56836c4cdd5e4a3dd331b] # # patch "roster_merge.cc" # from [7c9664a62bd7bb84afce479ffcdfbe4ec82aa015] # to [de299cc9be1090e4b906e68cb7179e9f5127bae7] # ============================================================ --- cmd_merging.cc 6f7293c9f832b0a5ac5aa91e21164df2787381c3 +++ cmd_merging.cc 89b55863602631a158f56836c4cdd5e4a3dd331b @@ -250,13 +250,14 @@ CMD(update, "update", "", CMD_REF(worksp roster_merge_result result; - // If we are not switching branches, we treat the workspace as a revision - // that has not yet been committed, and do a normal merge. This supports - // sutures and splits. + // If we are not switching branches, and the user has not specified a + // specific revision, we treat the workspace as a revision that has not + // yet been committed, and do a normal merge. This supports sutures and + // splits. // - // If we are switching branches, we assume the user wants to apply their - // local changes to the selected revision in the new branch. - if (!switched_branch) + // Otherwise, we assume the user wants to apply their local changes to the + // specified revision or branch head, not merge. + if (!switched_branch && app.opts.revision_selectors.size() == 0) { // working is an immediate child of base, so working_uncommon_ancestors = // base_uncommon_ancestors + working. @@ -272,8 +273,8 @@ CMD(update, "update", "", CMD_REF(worksp else { // Switching branches. This doesn't directly apply the cset - // base->working to chosen, but it is the algorithm used by monotone - // before suture/split was implemented, so we keep it. + // base->working to chosen, but the effect is the same, and this + // handles conflicts. // We have: // ============================================================ --- roster_merge.cc 7c9664a62bd7bb84afce479ffcdfbe4ec82aa015 +++ roster_merge.cc de299cc9be1090e4b906e68cb7179e9f5127bae7 @@ -1563,16 +1563,18 @@ parse_resolve_conflicts_opts (options co // the conflicts in the same order they are generated; see merge.cc // resolve_merge_conflicts. - // We should not get here if there are any conflicts we don't support, - // so assert that first. - I(!result.missing_root_dir); - I(result.invalid_name_conflicts.size() == 0); - I(result.directory_loop_conflicts.size() == 0); - I(result.orphaned_node_conflicts.size() == 0); - I(result.multiple_name_conflicts.size() == 0); - I(result.attribute_conflicts.size() == 0); - I(result.file_content_conflicts.size() == 0); + // If there are any conflicts for which we don't currently support + // resolutions, give a nice error message. + char const * const msg = "conflict resolution for %s not yet supported"; + N(!result.missing_root_dir, F(msg) % "missing_root_dir"); + N(result.invalid_name_conflicts.size() == 0, F(msg) % "invalid_name_conflicts"); + N(result.directory_loop_conflicts.size() == 0, F(msg) % "directory_loop_conflicts"); + N(result.orphaned_node_conflicts.size() == 0, F(msg) % "orphaned_node_conflicts"); + N(result.multiple_name_conflicts.size() == 0, F(msg) % "multiple_name_conflicts"); + N(result.attribute_conflicts.size() == 0, F(msg) % "attribute_conflicts"); + N(result.file_content_conflicts.size() == 0, F(msg) % "file_content_conflicts"); + // These are the ones we know how to resolve. parse_duplicate_name_conflicts(pars, result.duplicate_name_conflicts, left_roster, right_roster);