diff hgext/histedit.py @ 25452:43906060a3f4

histedit: abort rather than edit a public changeset (issue4704) This is suboptimal as the user still has to explicitly cancel the histedit afterwards, but it prevents the immediate problem. histedit should probably implicitly do 'hg histedit --abort' if a util.Abort is raised internally.
author Augie Fackler <augie@google.com>
date Fri, 05 Jun 2015 15:20:33 -0400
parents 7e36c3000ead
children 328739ea70c3
line wrap: on
line diff
--- a/hgext/histedit.py	Fri Jun 05 15:06:58 2015 -0400
+++ b/hgext/histedit.py	Fri Jun 05 15:20:33 2015 -0400
@@ -433,6 +433,10 @@
     ctxs = list(repo.set('%d::%d', first, last))
     if not ctxs:
         return None
+    for c in ctxs:
+        if not c.mutable():
+            raise util.Abort(
+                _("cannot fold into public change %s") % node.short(c.node()))
     base = first.parents()[0]
 
     # commit a new version of the old changeset, including the update