hgext/histedit.py
changeset 17762 57f27cbfc5bb
parent 17761 c80a7a0c7d22
child 17765 ef7760f0be87
--- a/hgext/histedit.py	Thu Sep 27 14:00:52 2012 +0200
+++ b/hgext/histedit.py	Fri Oct 12 21:41:08 2012 +0200
@@ -588,8 +588,12 @@
 
     When keep is false, the specified set can't have children."""
     revs = list(repo.set('%n::%n', old, new))
-    if not keep and repo.revs('(%ld::) - (%ld + hidden())', revs, revs):
-        raise util.Abort(_('cannot edit history that would orphan nodes'))
+    if not keep:
+        if repo.revs('(%ld::) - (%ld + hidden())', revs, revs):
+            raise util.Abort(_('cannot edit history that would orphan nodes'))
+        root = min(revs)
+        if not root.phase():
+            raise util.Abort(_('cannot edit immutable changeset: %s') % root)
     return [c.node() for c in revs]