[PATCH 1 of 2] histedit: check mutability of contexts correctly

Augie Fackler raf at durin42.com
Thu Sep 11 09:07:16 CDT 2014


# HG changeset patch
# User Augie Fackler <raf at durin42.com>
# Date 1408473181 14400
#      Tue Aug 19 14:33:01 2014 -0400
# Node ID 0d4fe8a14d5f92e2dc8349ff5191dc64017d1637
# Parent  c828b61e06355748cca92890ab7f137cbdc42966
histedit: check mutability of contexts correctly

The right way to check if a context is mutable is to call .mutable(),
not to compare .phase() with public.

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -749,7 +749,7 @@
         if repo.revs('(%ld) and merge()', ctxs):
             raise util.Abort(_('cannot edit history that contains merges'))
         root = ctxs[0] # list is already sorted by repo.set
-        if not root.phase():
+        if not root.mutable():
             raise util.Abort(_('cannot edit immutable changeset: %s') % root)
     return [c.node() for c in ctxs]
 


More information about the Mercurial-devel mailing list