comparison 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
comparison
equal deleted inserted replaced
8831:91e26fb24fb1 8832:6e6f5b80e056
625 def finish(self, repo, revs): 625 def finish(self, repo, revs):
626 firstrev = repo[self.applied[0].rev].rev() 626 firstrev = repo[self.applied[0].rev].rev()
627 appliedbase = 0 627 appliedbase = 0
628 patches = [] 628 patches = []
629 for rev in sorted(revs): 629 for rev in sorted(revs):
630
630 if rev < firstrev: 631 if rev < firstrev:
631 raise util.Abort(_('revision %d is not managed') % rev) 632 raise util.Abort(_('revision %d is not managed') % rev)
632 base = bin(self.applied[appliedbase].rev) 633 base = bin(self.applied[appliedbase].rev)
633 node = repo.changelog.node(rev) 634
634 if node != base: 635 ctx = repo[rev]
635 raise util.Abort(_('cannot delete revision %d above ' 636 if ctx.node() != base:
636 'applied patches') % rev) 637 msg = _('cannot delete revision %d above applied patches')
638 raise util.Abort(msg % rev)
639
640 patch = self.applied[appliedbase].name
641 for fmt in ('[mq]: %s', 'imported patch %s'):
642 if ctx.description() == fmt % patch:
643 msg = _('patch %s finalized without changeset message\n')
644 repo.ui.status(msg % patch)
645 break
646
637 patches.append(self.applied[appliedbase].name) 647 patches.append(self.applied[appliedbase].name)
638 appliedbase += 1 648 appliedbase += 1
639 649
640 r = self.qrepo() 650 r = self.qrepo()
641 if r: 651 if r: