Mercurial > hg > mercurial-crew-with-dirclash
comparison hgext/mq.py @ 3179:245bb70d7dfb
mq: raise util.Abort instead of using sys.exit(1)
author | Brendan Cully <brendan@kublai.com> |
---|---|
date | Thu, 28 Sep 2006 11:41:33 -0700 |
parents | b3e103c388fc |
children | 53e843840349 |
comparison
equal
deleted
inserted
replaced
3178:b3e103c388fc | 3179:245bb70d7dfb |
---|---|
801 mergeq=None, wlock=None): | 801 mergeq=None, wlock=None): |
802 if not wlock: | 802 if not wlock: |
803 wlock = repo.wlock() | 803 wlock = repo.wlock() |
804 patch = self.lookup(patch) | 804 patch = self.lookup(patch) |
805 if patch and self.isapplied(patch): | 805 if patch and self.isapplied(patch): |
806 self.ui.warn(_("patch %s is already applied\n") % patch) | 806 raise util.Abort(_("patch %s is already applied") % patch) |
807 sys.exit(1) | |
808 if self.series_end() == len(self.series): | 807 if self.series_end() == len(self.series): |
809 self.ui.warn(_("patch series fully applied\n")) | 808 raise util.Abort(_("patch series fully applied")) |
810 sys.exit(1) | |
811 if not force: | 809 if not force: |
812 self.check_localchanges(repo) | 810 self.check_localchanges(repo) |
813 | 811 |
814 self.applied_dirty = 1; | 812 self.applied_dirty = 1; |
815 start = self.series_end() | 813 start = self.series_end() |
855 patch = self.lookup(patch) | 853 patch = self.lookup(patch) |
856 info = self.isapplied(patch) | 854 info = self.isapplied(patch) |
857 if not info: | 855 if not info: |
858 raise util.Abort(_("patch %s is not applied") % patch) | 856 raise util.Abort(_("patch %s is not applied") % patch) |
859 if len(self.applied) == 0: | 857 if len(self.applied) == 0: |
860 self.ui.warn(_("no patches applied\n")) | 858 raise util.Abort(_("no patches applied")) |
861 sys.exit(1) | |
862 | 859 |
863 if not update: | 860 if not update: |
864 parents = repo.dirstate.parents() | 861 parents = repo.dirstate.parents() |
865 rr = [ revlog.bin(x.rev) for x in self.applied ] | 862 rr = [ revlog.bin(x.rev) for x in self.applied ] |
866 for p in parents: | 863 for p in parents: |
1376 if patch not in q.series: | 1373 if patch not in q.series: |
1377 raise util.Abort(_("patch %s is not in series file") % patch) | 1374 raise util.Abort(_("patch %s is not in series file") % patch) |
1378 end = q.series.index(patch) + 1 | 1375 end = q.series.index(patch) + 1 |
1379 else: | 1376 else: |
1380 end = len(q.applied) | 1377 end = len(q.applied) |
1378 if not end: | |
1379 return | |
1380 | |
1381 return q.qseries(repo, length=end, status='A', summary=opts.get('summary')) | 1381 return q.qseries(repo, length=end, status='A', summary=opts.get('summary')) |
1382 | 1382 |
1383 def unapplied(ui, repo, patch=None, **opts): | 1383 def unapplied(ui, repo, patch=None, **opts): |
1384 """print the patches not yet applied""" | 1384 """print the patches not yet applied""" |
1385 q = repo.mq | 1385 q = repo.mq |