# # # patch "cmd_merging.cc" # from [6ee48e48d6ab44eb64335ee5fefc0f1bc0e3a4cb] # to [546983474b5af1e3b529f2a01d0a54f6918f190f] # # patch "tests/noop_merge_into_workspace/__driver__.lua" # from [c35b200e70b0ba653022eec3e5da6939e335a306] # to [6b3882799c8273d99fbe9a4fe3d8aca06cd68c73] # ============================================================ --- cmd_merging.cc 6ee48e48d6ab44eb64335ee5fefc0f1bc0e3a4cb +++ cmd_merging.cc 546983474b5af1e3b529f2a01d0a54f6918f190f @@ -743,6 +743,12 @@ CMD(merge_into_workspace, "merge_into_wo N(!(left_id == right_id), F("workspace is already at revision %s") % left_id); + N(!is_ancestor(db, right_id, left_id), + F("revision %s is already an ancestor of your workspace") % right_id); + N(!is_ancestor(db, left_id, right_id), + F("revision %s is a descendant of the workspace parent,\n" + "did you mean 'mtn update -r %s'?") % right_id % right_id); + P(F("[left] %s") % left_id); P(F("[right] %s") % right_id); ============================================================ --- tests/noop_merge_into_workspace/__driver__.lua c35b200e70b0ba653022eec3e5da6939e335a306 +++ tests/noop_merge_into_workspace/__driver__.lua 6b3882799c8273d99fbe9a4fe3d8aca06cd68c73 @@ -10,5 +10,5 @@ check(mtn("merge_into_workspace", parent check(mtn("merge_into_workspace", parent), 1, nil, false) -check(mtn("update", "--revision", parent), 0, false) +check(mtn("update", "--revision", parent), 0, false, false) check(mtn("merge_into_workspace", child), 1, nil, false)