Show More
@@ -99,7 +99,7 b' def dodiff(ui, repo, diffcmd, diffopts, ' | |||||
99 | fp.write(chunk) |
|
99 | fp.write(chunk) | |
100 | return dirname |
|
100 | return dirname | |
101 |
|
101 | |||
102 |
node1, node2 = cmdutil.revpair( |
|
102 | node1, node2 = cmdutil.revpair(repo, opts['rev']) | |
103 | files, matchfn, anypats = cmdutil.matchpats(repo, pats, opts) |
|
103 | files, matchfn, anypats = cmdutil.matchpats(repo, pats, opts) | |
104 | modified, added, removed, deleted, unknown = repo.status( |
|
104 | modified, added, removed, deleted, unknown = repo.status( | |
105 | node1, node2, files, match=matchfn)[:5] |
|
105 | node1, node2, files, match=matchfn)[:5] |
@@ -33,7 +33,7 b' from mercurial.demandload import *' | |||||
33 | from mercurial.i18n import gettext as _ |
|
33 | from mercurial.i18n import gettext as _ | |
34 | from mercurial import commands |
|
34 | from mercurial import commands | |
35 | demandload(globals(), "os sys re struct traceback errno bz2") |
|
35 | demandload(globals(), "os sys re struct traceback errno bz2") | |
36 |
demandload(globals(), "mercurial:cmdutil,hg,patch,revlog,u |
|
36 | demandload(globals(), "mercurial:cmdutil,hg,patch,revlog,util") | |
37 |
|
37 | |||
38 | commands.norepo += " qclone qversion" |
|
38 | commands.norepo += " qclone qversion" | |
39 |
|
39 | |||
@@ -502,7 +502,7 b' class queue:' | |||||
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 = cmdutil.revrange( |
|
505 | revs = cmdutil.revrange(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: | |
@@ -1315,7 +1315,7 b' class queue:' | |||||
1315 | if files: |
|
1315 | if files: | |
1316 | raise util.Abort(_('option "-r" not valid when importing ' |
|
1316 | raise util.Abort(_('option "-r" not valid when importing ' | |
1317 | 'files')) |
|
1317 | 'files')) | |
1318 |
rev = cmdutil.revrange( |
|
1318 | rev = cmdutil.revrange(repo, rev) | |
1319 | rev.sort(lambda x, y: cmp(y, x)) |
|
1319 | rev.sort(lambda x, y: cmp(y, x)) | |
1320 | if (len(files) > 1 or len(rev) > 1) and patchname: |
|
1320 | if (len(files) > 1 or len(rev) > 1) and patchname: | |
1321 | raise util.Abort(_('option "-n" not valid when importing multiple ' |
|
1321 | raise util.Abort(_('option "-n" not valid when importing multiple ' |
@@ -13,7 +13,7 b" demandload(globals(), 'mdiff util templa" | |||||
13 |
|
13 | |||
14 | revrangesep = ':' |
|
14 | revrangesep = ':' | |
15 |
|
15 | |||
16 |
def revpair( |
|
16 | def revpair(repo, revs): | |
17 | '''return pair of nodes, given list of revisions. second item can |
|
17 | '''return pair of nodes, given list of revisions. second item can | |
18 | be None, meaning use working dir.''' |
|
18 | be None, meaning use working dir.''' | |
19 |
|
19 | |||
@@ -41,7 +41,7 b' def revpair(ui, repo, revs):' | |||||
41 | raise util.Abort(_('too many revisions specified')) |
|
41 | raise util.Abort(_('too many revisions specified')) | |
42 | return start, end |
|
42 | return start, end | |
43 |
|
43 | |||
44 |
def revrange( |
|
44 | def revrange(repo, revs): | |
45 | """Yield revision as strings from a list of revision specifications.""" |
|
45 | """Yield revision as strings from a list of revision specifications.""" | |
46 |
|
46 | |||
47 | def revfix(repo, val, defval): |
|
47 | def revfix(repo, val, defval): | |
@@ -641,7 +641,7 b' def walkchangerevs(ui, repo, pats, chang' | |||||
641 | defrange = '%s:0' % repo.changectx().rev() |
|
641 | defrange = '%s:0' % repo.changectx().rev() | |
642 | else: |
|
642 | else: | |
643 | defrange = 'tip:0' |
|
643 | defrange = 'tip:0' | |
644 |
revs = revrange( |
|
644 | revs = revrange(repo, opts['rev'] or [defrange]) | |
645 | wanted = {} |
|
645 | wanted = {} | |
646 | slowpath = anypats or opts.get('removed') |
|
646 | slowpath = anypats or opts.get('removed') | |
647 | fncache = {} |
|
647 | fncache = {} |
@@ -835,7 +835,7 b' def diff(ui, repo, *pats, **opts):' | |||||
835 | it detects as binary. With -a, diff will generate a diff anyway, |
|
835 | it detects as binary. With -a, diff will generate a diff anyway, | |
836 | probably with undesirable results. |
|
836 | probably with undesirable results. | |
837 | """ |
|
837 | """ | |
838 |
node1, node2 = cmdutil.revpair( |
|
838 | node1, node2 = cmdutil.revpair(repo, opts['rev']) | |
839 |
|
839 | |||
840 | fns, matchfn, anypats = cmdutil.matchpats(repo, pats, opts) |
|
840 | fns, matchfn, anypats = cmdutil.matchpats(repo, pats, opts) | |
841 |
|
841 | |||
@@ -871,7 +871,7 b' def export(ui, repo, *changesets, **opts' | |||||
871 | """ |
|
871 | """ | |
872 | if not changesets: |
|
872 | if not changesets: | |
873 | raise util.Abort(_("export requires at least one changeset")) |
|
873 | raise util.Abort(_("export requires at least one changeset")) | |
874 |
revs = cmdutil.revrange( |
|
874 | revs = cmdutil.revrange(repo, changesets) | |
875 | if len(revs) > 1: |
|
875 | if len(revs) > 1: | |
876 | ui.note(_('exporting patches:\n')) |
|
876 | ui.note(_('exporting patches:\n')) | |
877 | else: |
|
877 | else: | |
@@ -1436,7 +1436,7 b' def log(ui, repo, *pats, **opts):' | |||||
1436 | count = 0 |
|
1436 | count = 0 | |
1437 |
|
1437 | |||
1438 | if opts['copies'] and opts['rev']: |
|
1438 | if opts['copies'] and opts['rev']: | |
1439 |
endrev = max(cmdutil.revrange( |
|
1439 | endrev = max(cmdutil.revrange(repo, opts['rev'])) + 1 | |
1440 | else: |
|
1440 | else: | |
1441 | endrev = repo.changelog.count() |
|
1441 | endrev = repo.changelog.count() | |
1442 | rcache = {} |
|
1442 | rcache = {} | |
@@ -2120,7 +2120,7 b' def status(ui, repo, *pats, **opts):' | |||||
2120 | """ |
|
2120 | """ | |
2121 |
|
2121 | |||
2122 | all = opts['all'] |
|
2122 | all = opts['all'] | |
2123 |
node1, node2 = cmdutil.revpair( |
|
2123 | node1, node2 = cmdutil.revpair(repo, opts.get('rev')) | |
2124 |
|
2124 | |||
2125 | files, matchfn, anypats = cmdutil.matchpats(repo, pats, opts) |
|
2125 | files, matchfn, anypats = cmdutil.matchpats(repo, pats, opts) | |
2126 | cwd = (pats and repo.getcwd()) or '' |
|
2126 | cwd = (pats and repo.getcwd()) or '' |
General Comments 0
You need to be logged in to leave comments.
Login now