##// END OF EJS Templates
Make revrange return a list of ints so that callers don't have to convert
Matt Mackall -
r3526:68341c06 default
parent child Browse files
Show More
@@ -502,7 +502,7 b' class queue:'
502 502 if opts.get('rev'):
503 503 if not self.applied:
504 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 506 if len(revs) > 1 and revs[0] > revs[1]:
507 507 revs.reverse()
508 508 for rev in revs:
@@ -1276,7 +1276,7 b' class queue:'
1276 1276 if files:
1277 1277 raise util.Abort(_('option "-r" not valid when importing '
1278 1278 'files'))
1279 rev = [int(r) for r in cmdutil.revrange(self.ui, repo, rev)]
1279 rev = cmdutil.revrange(self.ui, repo, rev)
1280 1280 rev.sort(lambda x, y: cmp(y, x))
1281 1281 if (len(files) > 1 or len(rev) > 1) and patchname:
1282 1282 raise util.Abort(_('option "-n" not valid when importing multiple '
@@ -49,7 +49,7 b' def revrange(ui, repo, revs):'
49 49 return defval
50 50 return repo.changelog.rev(repo.lookup(val))
51 51
52 seen = {}
52 seen, l = {}, []
53 53 for spec in revs:
54 54 if revrangesep in spec:
55 55 start, end = spec.split(revrangesep, 1)
@@ -60,13 +60,15 b' def revrange(ui, repo, revs):'
60 60 if rev in seen:
61 61 continue
62 62 seen[rev] = 1
63 yield rev
63 l.append(rev)
64 64 else:
65 65 rev = revfix(repo, spec, None)
66 66 if rev in seen:
67 67 continue
68 68 seen[rev] = 1
69 yield rev
69 l.append(rev)
70
71 return l
70 72
71 73 def make_filename(repo, pat, node,
72 74 total=None, seqno=None, revwidth=None, pathname=None):
@@ -102,7 +102,7 b' def walkchangerevs(ui, repo, pats, opts)'
102 102 defrange = '%s:0' % repo.changectx().rev()
103 103 else:
104 104 defrange = 'tip:0'
105 revs = map(int, cmdutil.revrange(ui, repo, opts['rev'] or [defrange]))
105 revs = cmdutil.revrange(ui, repo, opts['rev'] or [defrange])
106 106 wanted = {}
107 107 slowpath = anypats
108 108 fncache = {}
@@ -1375,7 +1375,7 b' def export(ui, repo, *changesets, **opts'
1375 1375 """
1376 1376 if not changesets:
1377 1377 raise util.Abort(_("export requires at least one changeset"))
1378 revs = list(cmdutil.revrange(ui, repo, changesets))
1378 revs = cmdutil.revrange(ui, repo, changesets)
1379 1379 if len(revs) > 1:
1380 1380 ui.note(_('exporting patches:\n'))
1381 1381 else:
@@ -1841,8 +1841,7 b' def log(ui, repo, *pats, **opts):'
1841 1841 count = 0
1842 1842
1843 1843 if opts['copies'] and opts['rev']:
1844 endrev = max([int(i)
1845 for i in cmdutil.revrange(ui, repo, opts['rev'])]) + 1
1844 endrev = max(cmdutil.revrange(ui, repo, opts['rev'])) + 1
1846 1845 else:
1847 1846 endrev = repo.changelog.count()
1848 1847 rcache = {}
General Comments 0
You need to be logged in to leave comments. Login now