phases: prevent mq to qimport immutable change.
--- a/hgext/mq.py Mon Dec 19 23:31:38 2011 +0100
+++ b/hgext/mq.py Wed Dec 21 23:47:18 2011 +0100
@@ -1765,6 +1765,9 @@
diffopts = self.diffopts({'git': git})
for r in rev:
+ if not repo[r].mutable():
+ raise util.Abort(_('revision %d is not mutable') % r,
+ hint=_('see "hg help phases" for details'))
p1, p2 = repo.changelog.parentrevs(r)
n = repo.changelog.node(r)
if p2 != nullrev:
--- a/tests/test-mq-qimport-fail-cleanup.t Mon Dec 19 23:31:38 2011 +0100
+++ b/tests/test-mq-qimport-fail-cleanup.t Wed Dec 21 23:47:18 2011 +0100
@@ -32,3 +32,9 @@
$ hg qseries
b.patch
+
+ $ hg pull -q -r 0 . # update phase
+ $ hg qimport -r 0
+ abort: revision 0 is not mutable
+ (see "hg help phases" for details)
+ [255]