diff --git a/hgext/mq.py b/hgext/mq.py --- a/hgext/mq.py +++ b/hgext/mq.py @@ -627,13 +627,23 @@ class queue(object): appliedbase = 0 patches = [] for rev in sorted(revs): + if rev < firstrev: raise util.Abort(_('revision %d is not managed') % rev) base = bin(self.applied[appliedbase].rev) - node = repo.changelog.node(rev) - if node != base: - raise util.Abort(_('cannot delete revision %d above ' - 'applied patches') % rev) + + ctx = repo[rev] + if ctx.node() != base: + msg = _('cannot delete revision %d above applied patches') + raise util.Abort(msg % rev) + + patch = self.applied[appliedbase].name + for fmt in ('[mq]: %s', 'imported patch %s'): + if ctx.description() == fmt % patch: + msg = _('patch %s finalized without changeset message\n') + repo.ui.status(msg % patch) + break + patches.append(self.applied[appliedbase].name) appliedbase += 1 diff --git a/tests/test-mq-qdelete.out b/tests/test-mq-qdelete.out --- a/tests/test-mq-qdelete.out +++ b/tests/test-mq-qdelete.out @@ -32,11 +32,14 @@ abort: unknown revision 'c'! applying c patch c is empty now at: c +patch a finalized without changeset message +patch b finalized without changeset message c 3 imported patch c 2 [mq]: b 1 [mq]: a 0 base +patch c finalized without changeset message 3 imported patch c 2 [mq]: b 1 [mq]: a diff --git a/tests/test-mq-qimport.out b/tests/test-mq-qimport.out --- a/tests/test-mq-qimport.out +++ b/tests/test-mq-qimport.out @@ -27,3 +27,5 @@ 1 files updated, 0 files merged, 0 files adding another.diff to series file applying another.diff now at: another.diff +patch b.diff finalized without changeset message +patch another.diff finalized without changeset message