Mercurial > public > mercurial-scm > hg-stable
diff hgext/mq.py @ 8832:6e6f5b80e056
mq: warn about finalizing patches without cset message
author | Dirkjan Ochtman <dirkjan@ochtman.nl> |
---|---|
date | Fri, 19 Jun 2009 12:37:29 +0200 |
parents | 8b35b08724eb |
children | 14639c050251 |
line wrap: on
line diff
--- a/hgext/mq.py Thu Jun 18 16:56:03 2009 -0500 +++ b/hgext/mq.py Fri Jun 19 12:37:29 2009 +0200 @@ -627,13 +627,23 @@ 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