diff --git a/hgext/mq.py b/hgext/mq.py --- a/hgext/mq.py +++ b/hgext/mq.py @@ -1765,6 +1765,9 @@ class queue(object): 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: diff --git a/tests/test-mq-qimport-fail-cleanup.t b/tests/test-mq-qimport-fail-cleanup.t --- a/tests/test-mq-qimport-fail-cleanup.t +++ b/tests/test-mq-qimport-fail-cleanup.t @@ -32,3 +32,9 @@ valid patches before fail added to serie $ 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]