# HG changeset patch # User Matt Mackall # Date 2011-10-08 19:18:18 # Node ID 1209de02034e3c82f34336cd12686e78294a763c # Parent 9d8115c5fbda3860b80e3afd13ded51f23b7c757 backout: deprecate/hide support for backing out merges This has never worked usefully: - it can't undo a completely unwanted merge, as it leaves the merge in the DAG - it can't undo a faulty merge as that means doing a merge correctly, not simply reverting to one or the other parent Both of these kinds of merge also require coordinated action among developers to avoid the bad merge continuing to affect future merges, so we should stop pretending that backout is of any help here. As backing out a merge now requires a hidden option, it can't be done by accident, but will continue to 'work' for anyone who's already dependent on --parent for some unknown reason. diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -364,7 +364,8 @@ def archive(ui, repo, dest, **opts): @command('backout', [('', 'merge', None, _('merge with old dirstate parent after backout')), - ('', 'parent', '', _('parent to choose when backing out merge'), _('REV')), + ('', 'parent', '', + _('parent to choose when backing out merge (DEPRECATED)'), _('REV')), ('r', 'rev', '', _('revision to backout'), _('REV')), ] + mergetoolopts + walkopts + commitopts + commitopts2, _('[OPTION]... [-r] REV')) @@ -424,8 +425,7 @@ def backout(ui, repo, node=None, rev=Non raise util.Abort(_('cannot backout a change with no parents')) if p2 != nullid: if not opts.get('parent'): - raise util.Abort(_('cannot backout a merge changeset without ' - '--parent')) + raise util.Abort(_('cannot backout a merge changeset')) p = repo.lookup(opts['parent']) if p not in (p1, p2): raise util.Abort(_('%s is not a parent of %s') % diff --git a/tests/test-backout.t b/tests/test-backout.t --- a/tests/test-backout.t +++ b/tests/test-backout.t @@ -182,7 +182,7 @@ with --merge backout of merge should fail $ hg backout 4 - abort: cannot backout a merge changeset without --parent + abort: cannot backout a merge changeset [255] backout of merge with bad parent should fail