# HG changeset patch # User Dirkjan Ochtman # Date 1245407849 -7200 # Node ID 6e6f5b80e0561440368761985928615fde085cc0 # Parent 91e26fb24fb154ca55953a3445c514c7819e1e6b mq: warn about finalizing patches without cset message diff -r 91e26fb24fb1 -r 6e6f5b80e056 hgext/mq.py --- 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 diff -r 91e26fb24fb1 -r 6e6f5b80e056 tests/test-mq-qdelete.out --- a/tests/test-mq-qdelete.out Thu Jun 18 16:56:03 2009 -0500 +++ b/tests/test-mq-qdelete.out Fri Jun 19 12:37:29 2009 +0200 @@ -32,11 +32,14 @@ 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 -r 91e26fb24fb1 -r 6e6f5b80e056 tests/test-mq-qimport.out --- a/tests/test-mq-qimport.out Thu Jun 18 16:56:03 2009 -0500 +++ b/tests/test-mq-qimport.out Fri Jun 19 12:37:29 2009 +0200 @@ -27,3 +27,5 @@ 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