hgext/evolve.py
branchstable
changeset 475 9f69a5e41ab0
parent 418 18a0d96ed559
child 476 f17a0f801e0b
--- a/hgext/evolve.py	Tue Aug 21 12:38:19 2012 +0200
+++ b/hgext/evolve.py	Tue Aug 21 12:42:09 2012 +0200
@@ -413,11 +413,11 @@
     try:
         wlock = repo.wlock()
         try:
+            if old.phase() == phases.public:
+                raise util.Abort(_("can not rewrite immutable changeset %s")
+                                 % old)
             tr = repo.transaction('amend')
             try:
-                if old.phase() == phases.public:
-                    raise util.Abort(_("can not rewrite immutable changeset %s")
-                                     % old)
                 oldphase = old.phase()
                 # commit current changes as update
                 # code copied from commands.commit to avoid noisy messages