comparison mercurial/commands.py @ 3557: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 7ed86c28f1ae
children 45620faafa28
comparison
equal deleted inserted replaced
3556:cf0f8d9256c7 3557:68341c06bc61
100 100
101 if follow: 101 if follow:
102 defrange = '%s:0' % repo.changectx().rev() 102 defrange = '%s:0' % repo.changectx().rev()
103 else: 103 else:
104 defrange = 'tip:0' 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 wanted = {} 106 wanted = {}
107 slowpath = anypats 107 slowpath = anypats
108 fncache = {} 108 fncache = {}
109 109
110 chcache = {} 110 chcache = {}
1373 With the --switch-parent option, the diff will be against the second 1373 With the --switch-parent option, the diff will be against the second
1374 parent. It can be useful to review a merge. 1374 parent. It can be useful to review a merge.
1375 """ 1375 """
1376 if not changesets: 1376 if not changesets:
1377 raise util.Abort(_("export requires at least one changeset")) 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 if len(revs) > 1: 1379 if len(revs) > 1:
1380 ui.note(_('exporting patches:\n')) 1380 ui.note(_('exporting patches:\n'))
1381 else: 1381 else:
1382 ui.note(_('exporting patch:\n')) 1382 ui.note(_('exporting patch:\n'))
1383 patch.export(repo, map(repo.lookup, revs), template=opts['output'], 1383 patch.export(repo, map(repo.lookup, revs), template=opts['output'],
1839 else: 1839 else:
1840 limit = sys.maxint 1840 limit = sys.maxint
1841 count = 0 1841 count = 0
1842 1842
1843 if opts['copies'] and opts['rev']: 1843 if opts['copies'] and opts['rev']:
1844 endrev = max([int(i) 1844 endrev = max(cmdutil.revrange(ui, repo, opts['rev'])) + 1
1845 for i in cmdutil.revrange(ui, repo, opts['rev'])]) + 1
1846 else: 1845 else:
1847 endrev = repo.changelog.count() 1846 endrev = repo.changelog.count()
1848 rcache = {} 1847 rcache = {}
1849 ncache = {} 1848 ncache = {}
1850 dcache = [] 1849 dcache = []