comparison mercurial/commands.py @ 18163:c5bd753c5bc6

amend: allow amend of non-head when obsolete is enabled Obsolescence marker can represent this situation just fine. The old version is marked as precursor of the new changeset. All its descendants become "unstable". If obsolescence is not enabled we keep the current behavior of aborting. This new behavior only applies when obsolete is enabled and is subject to future discussion and changes.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Mon, 31 Dec 2012 17:44:18 -0600
parents 242d2f4ec01c
children c7d258cd77e5
comparison
equal deleted inserted replaced
18162:df1b37c8ae67 18163:c5bd753c5bc6
1294 raise util.Abort(_('cannot amend public changesets')) 1294 raise util.Abort(_('cannot amend public changesets'))
1295 if len(old.parents()) > 1: 1295 if len(old.parents()) > 1:
1296 raise util.Abort(_('cannot amend merge changesets')) 1296 raise util.Abort(_('cannot amend merge changesets'))
1297 if len(repo[None].parents()) > 1: 1297 if len(repo[None].parents()) > 1:
1298 raise util.Abort(_('cannot amend while merging')) 1298 raise util.Abort(_('cannot amend while merging'))
1299 if old.children(): 1299 if (not obsolete._enabled) and old.children():
1300 raise util.Abort(_('cannot amend changeset with children')) 1300 raise util.Abort(_('cannot amend changeset with children'))
1301 1301
1302 e = cmdutil.commiteditor 1302 e = cmdutil.commiteditor
1303 if opts.get('force_editor'): 1303 if opts.get('force_editor'):
1304 e = cmdutil.commitforceeditor 1304 e = cmdutil.commitforceeditor