hgext/mq.py
branchstable
changeset 16048 140b6282ac79
parent 16043 74d00b5d00cc
child 16057 db4b0532dbf2
child 16063 c36db39b3fee
--- a/hgext/mq.py	Tue Jan 31 23:13:04 2012 -0600
+++ b/hgext/mq.py	Wed Feb 01 12:20:10 2012 +0100
@@ -1313,6 +1313,10 @@
             if heads != [self.applied[-1].node]:
                 raise util.Abort(_("popping would remove a revision not "
                                    "managed by this patch queue"))
+            if not repo[self.applied[-1].node].mutable():
+                raise util.Abort(
+                    _("popping would remove an immutable revision"),
+                    hint=_('see "hg help phases" for details'))
 
             # we know there are no local changes, so we can make a simplified
             # form of hg.update.
@@ -1374,6 +1378,9 @@
             (top, patchfn) = (self.applied[-1].node, self.applied[-1].name)
             if repo.changelog.heads(top) != [top]:
                 raise util.Abort(_("cannot refresh a revision with children"))
+            if not repo[top].mutable():
+                raise util.Abort(_("cannot refresh immutable revision"),
+                                 hint=_('see "hg help phases" for details'))
 
             inclsubs = self.checksubstate(repo)