diff 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
line wrap: on
line diff
--- a/mercurial/commands.py	Fri Dec 21 22:58:59 2012 +0100
+++ b/mercurial/commands.py	Mon Dec 31 17:44:18 2012 -0600
@@ -1296,7 +1296,7 @@
             raise util.Abort(_('cannot amend merge changesets'))
         if len(repo[None].parents()) > 1:
             raise util.Abort(_('cannot amend while merging'))
-        if old.children():
+        if (not obsolete._enabled) and old.children():
             raise util.Abort(_('cannot amend changeset with children'))
 
         e = cmdutil.commiteditor