# HG changeset patch # User Matt Mackall # Date 1318101498 18000 # 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 -r 9d8115c5fbda -r 1209de02034e mercurial/commands.py --- a/mercurial/commands.py Sat Oct 08 13:28:13 2011 -0500 +++ b/mercurial/commands.py Sat Oct 08 14:18:18 2011 -0500 @@ -364,7 +364,8 @@ @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 @@ 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 -r 9d8115c5fbda -r 1209de02034e tests/test-backout.t --- a/tests/test-backout.t Sat Oct 08 13:28:13 2011 -0500 +++ b/tests/test-backout.t Sat Oct 08 14:18:18 2011 -0500 @@ -182,7 +182,7 @@ 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