Patchwork [1,of,2] histedit: check mutability of contexts correctly

login
register
mail settings
Submitter Augie Fackler
Date Sept. 11, 2014, 2:07 p.m.
Message ID <0d4fe8a14d5f92e2dc83.1410444436@arthedain.pit.corp.google.com>
Download mbox | patch
Permalink /patch/5798/
State Accepted
Headers show

Comments

Augie Fackler - Sept. 11, 2014, 2:07 p.m.
# HG changeset patch
# User Augie Fackler <raf@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.

Patch

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]