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.
--- 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') %
--- 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