Mercurial > hg
comparison hgext/mq.py @ 11216:1abd9442727c
mq: remove unneeded local variable in delete
author | Martin Geisler <mg@lazybytes.net> |
---|---|
date | Mon, 24 May 2010 00:55:42 +0200 |
parents | e43c23d189a5 |
children | 1e701ffd9df4 |
comparison
equal
deleted
inserted
replaced
11215:ebc90fd4ebc0 | 11216:1abd9442727c |
---|---|
739 def delete(self, repo, patches, opts): | 739 def delete(self, repo, patches, opts): |
740 if not patches and not opts.get('rev'): | 740 if not patches and not opts.get('rev'): |
741 raise util.Abort(_('qdelete requires at least one revision or ' | 741 raise util.Abort(_('qdelete requires at least one revision or ' |
742 'patch name')) | 742 'patch name')) |
743 | 743 |
744 realpatches = [] | |
745 for patch in patches: | 744 for patch in patches: |
746 patch = self.lookup(patch, strict=True) | 745 patch = self.lookup(patch, strict=True) |
747 info = self.isapplied(patch) | 746 info = self.isapplied(patch) |
748 if info: | 747 if info: |
749 raise util.Abort(_("cannot delete applied patch %s") % patch) | 748 raise util.Abort(_("cannot delete applied patch %s") % patch) |
750 if patch not in self.series: | 749 if patch not in self.series: |
751 raise util.Abort(_("patch %s not in series file") % patch) | 750 raise util.Abort(_("patch %s not in series file") % patch) |
752 realpatches.append(patch) | 751 |
753 | 752 patches = list(patches) |
754 numrevs = 0 | 753 numrevs = 0 |
755 if opts.get('rev'): | 754 if opts.get('rev'): |
756 if not self.applied: | 755 if not self.applied: |
757 raise util.Abort(_('no patches applied')) | 756 raise util.Abort(_('no patches applied')) |
758 revs = cmdutil.revrange(repo, opts['rev']) | 757 revs = cmdutil.revrange(repo, opts['rev']) |
759 if len(revs) > 1 and revs[0] > revs[1]: | 758 if len(revs) > 1 and revs[0] > revs[1]: |
760 revs.reverse() | 759 revs.reverse() |
761 revpatches = self._revpatches(repo, revs) | 760 revpatches = self._revpatches(repo, revs) |
762 realpatches += revpatches | 761 patches += revpatches |
763 numrevs = len(revpatches) | 762 numrevs = len(revpatches) |
764 | 763 |
765 self._cleanup(realpatches, numrevs, opts.get('keep')) | 764 self._cleanup(patches, numrevs, opts.get('keep')) |
766 | 765 |
767 def check_toppatch(self, repo): | 766 def check_toppatch(self, repo): |
768 if self.applied: | 767 if self.applied: |
769 top = self.applied[-1].node | 768 top = self.applied[-1].node |
770 patch = self.applied[-1].name | 769 patch = self.applied[-1].name |