comparison hgext/mq.py @ 3526:68341c06bc61

Make revrange return a list of ints so that callers don't have to convert
author Matt Mackall <mpm@selenic.com>
date Thu, 26 Oct 2006 17:27:07 -0500
parents fbf8320f25c8
children 4d97184a06ad
comparison
equal deleted inserted replaced
3525:cf0f8d9256c7 3526:68341c06bc61
500 500
501 appliedbase = 0 501 appliedbase = 0
502 if opts.get('rev'): 502 if opts.get('rev'):
503 if not self.applied: 503 if not self.applied:
504 raise util.Abort(_('no patches applied')) 504 raise util.Abort(_('no patches applied'))
505 revs = [int(r) for r in cmdutil.revrange(ui, repo, opts['rev'])] 505 revs = cmdutil.revrange(ui, repo, opts['rev'])
506 if len(revs) > 1 and revs[0] > revs[1]: 506 if len(revs) > 1 and revs[0] > revs[1]:
507 revs.reverse() 507 revs.reverse()
508 for rev in revs: 508 for rev in revs:
509 if appliedbase >= len(self.applied): 509 if appliedbase >= len(self.applied):
510 raise util.Abort(_("revision %d is not managed") % rev) 510 raise util.Abort(_("revision %d is not managed") % rev)
1274 1274
1275 if rev: 1275 if rev:
1276 if files: 1276 if files:
1277 raise util.Abort(_('option "-r" not valid when importing ' 1277 raise util.Abort(_('option "-r" not valid when importing '
1278 'files')) 1278 'files'))
1279 rev = [int(r) for r in cmdutil.revrange(self.ui, repo, rev)] 1279 rev = cmdutil.revrange(self.ui, repo, rev)
1280 rev.sort(lambda x, y: cmp(y, x)) 1280 rev.sort(lambda x, y: cmp(y, x))
1281 if (len(files) > 1 or len(rev) > 1) and patchname: 1281 if (len(files) > 1 or len(rev) > 1) and patchname:
1282 raise util.Abort(_('option "-n" not valid when importing multiple ' 1282 raise util.Abort(_('option "-n" not valid when importing multiple '
1283 'patches')) 1283 'patches'))
1284 i = 0 1284 i = 0