hgext/uncommit.py
changeset 35435 f01101100043
parent 35400 8a0cac20a1ad
child 35809 f9a82b9b2c36
--- a/hgext/uncommit.py	Wed Dec 13 10:29:22 2017 -0800
+++ b/hgext/uncommit.py	Wed Dec 13 17:03:39 2017 -0800
@@ -208,8 +208,7 @@
         # identify the commit from which to unamend
         curctx = repo['.']
 
-        if not curctx.mutable():
-            raise error.Abort(_('cannot unamend public changesets'))
+        rewriteutil.precheck(repo, [curctx.rev()], 'unamend')
 
         # identify the commit to which to unamend
         markers = list(predecessormarkers(curctx))
@@ -220,9 +219,6 @@
         prednode = markers[0].prednode()
         predctx = unfi[prednode]
 
-        if curctx.children():
-            raise error.Abort(_("cannot unamend a changeset with children"))
-
         # add an extra so that we get a new hash
         # note: allowing unamend to undo an unamend is an intentional feature
         extras = predctx.extra()