Show More
@@ -35,6 +35,7 b' from mercurial.node import short' | |||||
35 |
|
35 | |||
36 | from mercurial import ( |
|
36 | from mercurial import ( | |
37 | error, |
|
37 | error, | |
|
38 | logcmdutil, | |||
38 | registrar, |
|
39 | registrar, | |
39 | scmutil, |
|
40 | scmutil, | |
40 | ) |
|
41 | ) | |
@@ -84,7 +85,7 b" def _docensor(ui, repo, path, rev=b'', t" | |||||
84 | if not len(flog): |
|
85 | if not len(flog): | |
85 | raise error.Abort(_(b'cannot censor file with no history')) |
|
86 | raise error.Abort(_(b'cannot censor file with no history')) | |
86 |
|
87 | |||
87 |
rev = |
|
88 | rev = logcmdutil.revsingle(repo, rev, rev).rev() | |
88 | try: |
|
89 | try: | |
89 | ctx = repo[rev] |
|
90 | ctx = repo[rev] | |
90 | except KeyError: |
|
91 | except KeyError: |
@@ -22,7 +22,6 b' from mercurial import (' | |||||
22 | logcmdutil, |
|
22 | logcmdutil, | |
23 | pycompat, |
|
23 | pycompat, | |
24 | registrar, |
|
24 | registrar, | |
25 | scmutil, |
|
|||
26 | ) |
|
25 | ) | |
27 |
|
26 | |||
28 | templateopts = cmdutil.templateopts |
|
27 | templateopts = cmdutil.templateopts | |
@@ -71,7 +70,7 b' def children(ui, repo, file_=None, **opt' | |||||
71 | """ |
|
70 | """ | |
72 | opts = pycompat.byteskwargs(opts) |
|
71 | opts = pycompat.byteskwargs(opts) | |
73 | rev = opts.get(b'rev') |
|
72 | rev = opts.get(b'rev') | |
74 |
ctx = |
|
73 | ctx = logcmdutil.revsingle(repo, rev) | |
75 | if file_: |
|
74 | if file_: | |
76 | fctx = repo.filectx(file_, changeid=ctx.rev()) |
|
75 | fctx = repo.filectx(file_, changeid=ctx.rev()) | |
77 | childctxs = [fcctx.changectx() for fcctx in fctx.children()] |
|
76 | childctxs = [fcctx.changectx() for fcctx in fctx.children()] |
@@ -13,9 +13,9 b' from mercurial import (' | |||||
13 | cmdutil, |
|
13 | cmdutil, | |
14 | context, |
|
14 | context, | |
15 | error, |
|
15 | error, | |
|
16 | logcmdutil, | |||
16 | pycompat, |
|
17 | pycompat, | |
17 | registrar, |
|
18 | registrar, | |
18 | logcmdutil, |
|
|||
19 | ) |
|
19 | ) | |
20 |
|
20 | |||
21 | cmdtable = {} |
|
21 | cmdtable = {} |
@@ -559,15 +559,15 b' def dodiff(ui, repo, cmdline, pats, opts' | |||||
559 | do3way = b'$parent2' in cmdline |
|
559 | do3way = b'$parent2' in cmdline | |
560 |
|
560 | |||
561 | if change: |
|
561 | if change: | |
562 |
ctx2 = |
|
562 | ctx2 = logcmdutil.revsingle(repo, change, None) | |
563 | ctx1a, ctx1b = ctx2.p1(), ctx2.p2() |
|
563 | ctx1a, ctx1b = ctx2.p1(), ctx2.p2() | |
564 | elif from_rev or to_rev: |
|
564 | elif from_rev or to_rev: | |
565 | repo = scmutil.unhidehashlikerevs( |
|
565 | repo = scmutil.unhidehashlikerevs( | |
566 | repo, [from_rev] + [to_rev], b'nowarn' |
|
566 | repo, [from_rev] + [to_rev], b'nowarn' | |
567 | ) |
|
567 | ) | |
568 |
ctx1a = |
|
568 | ctx1a = logcmdutil.revsingle(repo, from_rev, None) | |
569 | ctx1b = repo[nullrev] |
|
569 | ctx1b = repo[nullrev] | |
570 |
ctx2 = |
|
570 | ctx2 = logcmdutil.revsingle(repo, to_rev, None) | |
571 | else: |
|
571 | else: | |
572 | ctx1a, ctx2 = logcmdutil.revpair(repo, revs) |
|
572 | ctx1a, ctx2 = logcmdutil.revpair(repo, revs) | |
573 | if not revs: |
|
573 | if not revs: |
@@ -15,6 +15,7 b' from mercurial import (' | |||||
15 | encoding, |
|
15 | encoding, | |
16 | error, |
|
16 | error, | |
17 | extensions, |
|
17 | extensions, | |
|
18 | logcmdutil, | |||
18 | patch, |
|
19 | patch, | |
19 | pycompat, |
|
20 | pycompat, | |
20 | registrar, |
|
21 | registrar, | |
@@ -75,7 +76,7 b' def _matchpaths(repo, rev, pats, opts, a' | |||||
75 | def bad(x, y): |
|
76 | def bad(x, y): | |
76 | raise error.Abort(b"%s: %s" % (x, y)) |
|
77 | raise error.Abort(b"%s: %s" % (x, y)) | |
77 |
|
78 | |||
78 |
ctx = |
|
79 | ctx = logcmdutil.revsingle(repo, rev) | |
79 | m = scmutil.match(ctx, pats, opts, badfn=bad) |
|
80 | m = scmutil.match(ctx, pats, opts, badfn=bad) | |
80 | for p in ctx.walk(m): |
|
81 | for p in ctx.walk(m): | |
81 | yield p |
|
82 | yield p | |
@@ -317,7 +318,7 b' def debugbuildannotatecache(ui, repo, *p' | |||||
317 | ) |
|
318 | ) | |
318 | if ui.configbool(b'fastannotate', b'unfilteredrepo'): |
|
319 | if ui.configbool(b'fastannotate', b'unfilteredrepo'): | |
319 | repo = repo.unfiltered() |
|
320 | repo = repo.unfiltered() | |
320 |
ctx = |
|
321 | ctx = logcmdutil.revsingle(repo, rev) | |
321 | m = scmutil.match(ctx, pats, opts) |
|
322 | m = scmutil.match(ctx, pats, opts) | |
322 | paths = list(ctx.walk(m)) |
|
323 | paths = list(ctx.walk(m)) | |
323 | if util.safehasattr(repo, 'prefetchfastannotate'): |
|
324 | if util.safehasattr(repo, 'prefetchfastannotate'): |
@@ -1667,7 +1667,7 b' def overridetransplant(orig, ui, repo, *' | |||||
1667 | @eh.wrapcommand(b'cat') |
|
1667 | @eh.wrapcommand(b'cat') | |
1668 | def overridecat(orig, ui, repo, file1, *pats, **opts): |
|
1668 | def overridecat(orig, ui, repo, file1, *pats, **opts): | |
1669 | opts = pycompat.byteskwargs(opts) |
|
1669 | opts = pycompat.byteskwargs(opts) | |
1670 |
ctx = |
|
1670 | ctx = logcmdutil.revsingle(repo, opts.get(b'rev')) | |
1671 | err = 1 |
|
1671 | err = 1 | |
1672 | notbad = set() |
|
1672 | notbad = set() | |
1673 | m = scmutil.match(ctx, (file1,) + pats, opts) |
|
1673 | m = scmutil.match(ctx, (file1,) + pats, opts) |
@@ -1323,7 +1323,7 b' def _definedestmap(ui, repo, inmemory, d' | |||||
1323 | return None |
|
1323 | return None | |
1324 | if destf: |
|
1324 | if destf: | |
1325 | # --base does not support multiple destinations |
|
1325 | # --base does not support multiple destinations | |
1326 |
dest = |
|
1326 | dest = logcmdutil.revsingle(repo, destf) | |
1327 | else: |
|
1327 | else: | |
1328 | dest = repo[_destrebase(repo, base, destspace=destspace)] |
|
1328 | dest = repo[_destrebase(repo, base, destspace=destspace)] | |
1329 | destf = bytes(dest) |
|
1329 | destf = bytes(dest) |
@@ -1480,7 +1480,7 b' def copy(ui, repo, pats, opts, rename=Fa' | |||||
1480 | # TODO: Remove this restriction and make it also create the copy |
|
1480 | # TODO: Remove this restriction and make it also create the copy | |
1481 | # targets (and remove the rename source if rename==True). |
|
1481 | # targets (and remove the rename source if rename==True). | |
1482 | raise error.InputError(_(b'--at-rev requires --after')) |
|
1482 | raise error.InputError(_(b'--at-rev requires --after')) | |
1483 |
ctx = |
|
1483 | ctx = logcmdutil.revsingle(repo, rev) | |
1484 | if len(ctx.parents()) > 1: |
|
1484 | if len(ctx.parents()) > 1: | |
1485 | raise error.InputError( |
|
1485 | raise error.InputError( | |
1486 | _(b'cannot mark/unmark copy in merge commit') |
|
1486 | _(b'cannot mark/unmark copy in merge commit') |
@@ -445,7 +445,7 b' def annotate(ui, repo, *pats, **opts):' | |||||
445 | rev = opts.get(b'rev') |
|
445 | rev = opts.get(b'rev') | |
446 | if rev: |
|
446 | if rev: | |
447 | repo = scmutil.unhidehashlikerevs(repo, [rev], b'nowarn') |
|
447 | repo = scmutil.unhidehashlikerevs(repo, [rev], b'nowarn') | |
448 |
ctx = |
|
448 | ctx = logcmdutil.revsingle(repo, rev) | |
449 |
|
449 | |||
450 | ui.pager(b'annotate') |
|
450 | ui.pager(b'annotate') | |
451 | rootfm = ui.formatter(b'annotate', opts) |
|
451 | rootfm = ui.formatter(b'annotate', opts) | |
@@ -649,7 +649,7 b' def archive(ui, repo, dest, **opts):' | |||||
649 | rev = opts.get(b'rev') |
|
649 | rev = opts.get(b'rev') | |
650 | if rev: |
|
650 | if rev: | |
651 | repo = scmutil.unhidehashlikerevs(repo, [rev], b'nowarn') |
|
651 | repo = scmutil.unhidehashlikerevs(repo, [rev], b'nowarn') | |
652 |
ctx = |
|
652 | ctx = logcmdutil.revsingle(repo, rev) | |
653 | if not ctx: |
|
653 | if not ctx: | |
654 | raise error.InputError( |
|
654 | raise error.InputError( | |
655 | _(b'no working directory: please specify a revision') |
|
655 | _(b'no working directory: please specify a revision') | |
@@ -791,7 +791,7 b' def _dobackout(ui, repo, node=None, rev=' | |||||
791 |
|
791 | |||
792 | cmdutil.checkunfinished(repo) |
|
792 | cmdutil.checkunfinished(repo) | |
793 | cmdutil.bailifchanged(repo) |
|
793 | cmdutil.bailifchanged(repo) | |
794 |
ctx = |
|
794 | ctx = logcmdutil.revsingle(repo, rev) | |
795 | node = ctx.node() |
|
795 | node = ctx.node() | |
796 |
|
796 | |||
797 | op1, op2 = repo.dirstate.parents() |
|
797 | op1, op2 = repo.dirstate.parents() | |
@@ -1761,7 +1761,7 b' def cat(ui, repo, file1, *pats, **opts):' | |||||
1761 | rev = opts.get(b'rev') |
|
1761 | rev = opts.get(b'rev') | |
1762 | if rev: |
|
1762 | if rev: | |
1763 | repo = scmutil.unhidehashlikerevs(repo, [rev], b'nowarn') |
|
1763 | repo = scmutil.unhidehashlikerevs(repo, [rev], b'nowarn') | |
1764 |
ctx = |
|
1764 | ctx = logcmdutil.revsingle(repo, rev) | |
1765 | m = scmutil.match(ctx, (file1,) + pats, opts) |
|
1765 | m = scmutil.match(ctx, (file1,) + pats, opts) | |
1766 | fntemplate = opts.pop(b'output', b'') |
|
1766 | fntemplate = opts.pop(b'output', b'') | |
1767 | if cmdutil.isstdiofilename(fntemplate): |
|
1767 | if cmdutil.isstdiofilename(fntemplate): | |
@@ -2600,14 +2600,14 b' def diff(ui, repo, *pats, **opts):' | |||||
2600 | cmdutil.check_incompatible_arguments(opts, b'to', [b'rev', b'change']) |
|
2600 | cmdutil.check_incompatible_arguments(opts, b'to', [b'rev', b'change']) | |
2601 | if change: |
|
2601 | if change: | |
2602 | repo = scmutil.unhidehashlikerevs(repo, [change], b'nowarn') |
|
2602 | repo = scmutil.unhidehashlikerevs(repo, [change], b'nowarn') | |
2603 |
ctx2 = |
|
2603 | ctx2 = logcmdutil.revsingle(repo, change, None) | |
2604 | ctx1 = logcmdutil.diff_parent(ctx2) |
|
2604 | ctx1 = logcmdutil.diff_parent(ctx2) | |
2605 | elif from_rev or to_rev: |
|
2605 | elif from_rev or to_rev: | |
2606 | repo = scmutil.unhidehashlikerevs( |
|
2606 | repo = scmutil.unhidehashlikerevs( | |
2607 | repo, [from_rev] + [to_rev], b'nowarn' |
|
2607 | repo, [from_rev] + [to_rev], b'nowarn' | |
2608 | ) |
|
2608 | ) | |
2609 |
ctx1 = |
|
2609 | ctx1 = logcmdutil.revsingle(repo, from_rev, None) | |
2610 |
ctx2 = |
|
2610 | ctx2 = logcmdutil.revsingle(repo, to_rev, None) | |
2611 | else: |
|
2611 | else: | |
2612 | repo = scmutil.unhidehashlikerevs(repo, revs, b'nowarn') |
|
2612 | repo = scmutil.unhidehashlikerevs(repo, revs, b'nowarn') | |
2613 | ctx1, ctx2 = logcmdutil.revpair(repo, revs) |
|
2613 | ctx1, ctx2 = logcmdutil.revpair(repo, revs) | |
@@ -2864,7 +2864,7 b' def files(ui, repo, *pats, **opts):' | |||||
2864 | rev = opts.get(b'rev') |
|
2864 | rev = opts.get(b'rev') | |
2865 | if rev: |
|
2865 | if rev: | |
2866 | repo = scmutil.unhidehashlikerevs(repo, [rev], b'nowarn') |
|
2866 | repo = scmutil.unhidehashlikerevs(repo, [rev], b'nowarn') | |
2867 |
ctx = |
|
2867 | ctx = logcmdutil.revsingle(repo, rev, None) | |
2868 |
|
2868 | |||
2869 | end = b'\n' |
|
2869 | end = b'\n' | |
2870 | if opts.get(b'print0'): |
|
2870 | if opts.get(b'print0'): | |
@@ -3175,7 +3175,7 b' def _dograft(ui, repo, *revs, **opts):' | |||||
3175 | skipped = set() |
|
3175 | skipped = set() | |
3176 | basectx = None |
|
3176 | basectx = None | |
3177 | if opts.get('base'): |
|
3177 | if opts.get('base'): | |
3178 |
basectx = |
|
3178 | basectx = logcmdutil.revsingle(repo, opts['base'], None) | |
3179 | if basectx is None: |
|
3179 | if basectx is None: | |
3180 | # check for merges |
|
3180 | # check for merges | |
3181 | for rev in repo.revs(b'%ld and merge()', revs): |
|
3181 | for rev in repo.revs(b'%ld and merge()', revs): | |
@@ -3696,7 +3696,7 b' def heads(ui, repo, *branchrevs, **opts)' | |||||
3696 | rev = opts.get(b'rev') |
|
3696 | rev = opts.get(b'rev') | |
3697 | if rev: |
|
3697 | if rev: | |
3698 | repo = scmutil.unhidehashlikerevs(repo, [rev], b'nowarn') |
|
3698 | repo = scmutil.unhidehashlikerevs(repo, [rev], b'nowarn') | |
3699 |
start = |
|
3699 | start = logcmdutil.revsingle(repo, rev, None).node() | |
3700 |
|
3700 | |||
3701 | if opts.get(b'topo'): |
|
3701 | if opts.get(b'topo'): | |
3702 | heads = [repo[h] for h in repo.heads(start)] |
|
3702 | heads = [repo[h] for h in repo.heads(start)] | |
@@ -3932,7 +3932,7 b' def identify(' | |||||
3932 | else: |
|
3932 | else: | |
3933 | if rev: |
|
3933 | if rev: | |
3934 | repo = scmutil.unhidehashlikerevs(repo, [rev], b'nowarn') |
|
3934 | repo = scmutil.unhidehashlikerevs(repo, [rev], b'nowarn') | |
3935 |
ctx = |
|
3935 | ctx = logcmdutil.revsingle(repo, rev, None) | |
3936 |
|
3936 | |||
3937 | if ctx.rev() is None: |
|
3937 | if ctx.rev() is None: | |
3938 | ctx = repo[None] |
|
3938 | ctx = repo[None] | |
@@ -4445,7 +4445,7 b' def locate(ui, repo, *pats, **opts):' | |||||
4445 | end = b'\0' |
|
4445 | end = b'\0' | |
4446 | else: |
|
4446 | else: | |
4447 | end = b'\n' |
|
4447 | end = b'\n' | |
4448 |
ctx = |
|
4448 | ctx = logcmdutil.revsingle(repo, opts.get(b'rev'), None) | |
4449 |
|
4449 | |||
4450 | ret = 1 |
|
4450 | ret = 1 | |
4451 | m = scmutil.match( |
|
4451 | m = scmutil.match( | |
@@ -4790,7 +4790,7 b' def manifest(ui, repo, node=None, rev=No' | |||||
4790 | mode = {b'l': b'644', b'x': b'755', b'': b'644', b't': b'755'} |
|
4790 | mode = {b'l': b'644', b'x': b'755', b'': b'644', b't': b'755'} | |
4791 | if node: |
|
4791 | if node: | |
4792 | repo = scmutil.unhidehashlikerevs(repo, [node], b'nowarn') |
|
4792 | repo = scmutil.unhidehashlikerevs(repo, [node], b'nowarn') | |
4793 |
ctx = |
|
4793 | ctx = logcmdutil.revsingle(repo, node) | |
4794 | mf = ctx.manifest() |
|
4794 | mf = ctx.manifest() | |
4795 | ui.pager(b'manifest') |
|
4795 | ui.pager(b'manifest') | |
4796 | for f in ctx: |
|
4796 | for f in ctx: | |
@@ -4877,7 +4877,7 b' def merge(ui, repo, node=None, **opts):' | |||||
4877 | node = opts.get(b'rev') |
|
4877 | node = opts.get(b'rev') | |
4878 |
|
4878 | |||
4879 | if node: |
|
4879 | if node: | |
4880 |
ctx = |
|
4880 | ctx = logcmdutil.revsingle(repo, node) | |
4881 | else: |
|
4881 | else: | |
4882 | if ui.configbool(b'commands', b'merge.require-rev'): |
|
4882 | if ui.configbool(b'commands', b'merge.require-rev'): | |
4883 | raise error.InputError( |
|
4883 | raise error.InputError( | |
@@ -5056,7 +5056,7 b' def parents(ui, repo, file_=None, **opts' | |||||
5056 | rev = opts.get(b'rev') |
|
5056 | rev = opts.get(b'rev') | |
5057 | if rev: |
|
5057 | if rev: | |
5058 | repo = scmutil.unhidehashlikerevs(repo, [rev], b'nowarn') |
|
5058 | repo = scmutil.unhidehashlikerevs(repo, [rev], b'nowarn') | |
5059 |
ctx = |
|
5059 | ctx = logcmdutil.revsingle(repo, rev, None) | |
5060 |
|
5060 | |||
5061 | if file_: |
|
5061 | if file_: | |
5062 | m = scmutil.match(ctx, (file_,), opts) |
|
5062 | m = scmutil.match(ctx, (file_,), opts) | |
@@ -6347,7 +6347,7 b' def revert(ui, repo, *pats, **opts):' | |||||
6347 | rev = opts.get(b'rev') |
|
6347 | rev = opts.get(b'rev') | |
6348 | if rev: |
|
6348 | if rev: | |
6349 | repo = scmutil.unhidehashlikerevs(repo, [rev], b'nowarn') |
|
6349 | repo = scmutil.unhidehashlikerevs(repo, [rev], b'nowarn') | |
6350 |
ctx = |
|
6350 | ctx = logcmdutil.revsingle(repo, rev) | |
6351 |
|
6351 | |||
6352 | if not ( |
|
6352 | if not ( | |
6353 | pats |
|
6353 | pats | |
@@ -6905,7 +6905,7 b' def status(ui, repo, *pats, **opts):' | |||||
6905 | raise error.InputError(msg) |
|
6905 | raise error.InputError(msg) | |
6906 | elif change: |
|
6906 | elif change: | |
6907 | repo = scmutil.unhidehashlikerevs(repo, [change], b'nowarn') |
|
6907 | repo = scmutil.unhidehashlikerevs(repo, [change], b'nowarn') | |
6908 |
ctx2 = |
|
6908 | ctx2 = logcmdutil.revsingle(repo, change, None) | |
6909 | ctx1 = ctx2.p1() |
|
6909 | ctx1 = ctx2.p1() | |
6910 | else: |
|
6910 | else: | |
6911 | repo = scmutil.unhidehashlikerevs(repo, revs, b'nowarn') |
|
6911 | repo = scmutil.unhidehashlikerevs(repo, revs, b'nowarn') | |
@@ -7453,7 +7453,7 b' def tag(ui, repo, name1, *names, **opts)' | |||||
7453 | b'(use -f to force)' |
|
7453 | b'(use -f to force)' | |
7454 | ) |
|
7454 | ) | |
7455 | ) |
|
7455 | ) | |
7456 |
node = |
|
7456 | node = logcmdutil.revsingle(repo, rev_).node() | |
7457 |
|
7457 | |||
7458 | if not message: |
|
7458 | if not message: | |
7459 | # we don't translate commit messages |
|
7459 | # we don't translate commit messages | |
@@ -7477,7 +7477,7 b' def tag(ui, repo, name1, *names, **opts)' | |||||
7477 | # don't allow tagging the null rev |
|
7477 | # don't allow tagging the null rev | |
7478 | if ( |
|
7478 | if ( | |
7479 | not opts.get(b'remove') |
|
7479 | not opts.get(b'remove') | |
7480 |
and |
|
7480 | and logcmdutil.revsingle(repo, rev_).rev() == nullrev | |
7481 | ): |
|
7481 | ): | |
7482 | raise error.InputError(_(b"cannot tag null revision")) |
|
7482 | raise error.InputError(_(b"cannot tag null revision")) | |
7483 |
|
7483 | |||
@@ -7840,7 +7840,7 b' def update(ui, repo, node=None, **opts):' | |||||
7840 | brev = rev |
|
7840 | brev = rev | |
7841 | if rev: |
|
7841 | if rev: | |
7842 | repo = scmutil.unhidehashlikerevs(repo, [rev], b'nowarn') |
|
7842 | repo = scmutil.unhidehashlikerevs(repo, [rev], b'nowarn') | |
7843 |
ctx = |
|
7843 | ctx = logcmdutil.revsingle(repo, rev, default=None) | |
7844 | rev = ctx.rev() |
|
7844 | rev = ctx.rev() | |
7845 | hidden = ctx.hidden() |
|
7845 | hidden = ctx.hidden() | |
7846 | overrides = {(b'ui', b'forcemerge'): opts.get('tool', b'')} |
|
7846 | overrides = {(b'ui', b'forcemerge'): opts.get('tool', b'')} |
@@ -506,7 +506,7 b' def debugcapabilities(ui, path, **opts):' | |||||
506 | ) |
|
506 | ) | |
507 | def debugchangedfiles(ui, repo, rev, **opts): |
|
507 | def debugchangedfiles(ui, repo, rev, **opts): | |
508 | """list the stored files changes for a revision""" |
|
508 | """list the stored files changes for a revision""" | |
509 |
ctx = |
|
509 | ctx = logcmdutil.revsingle(repo, rev, None) | |
510 | files = None |
|
510 | files = None | |
511 |
|
511 | |||
512 | if opts['compute']: |
|
512 | if opts['compute']: | |
@@ -1373,7 +1373,7 b' def debugfileset(ui, repo, expr, **opts)' | |||||
1373 |
|
1373 | |||
1374 | fileset.symbols # force import of fileset so we have predicates to optimize |
|
1374 | fileset.symbols # force import of fileset so we have predicates to optimize | |
1375 | opts = pycompat.byteskwargs(opts) |
|
1375 | opts = pycompat.byteskwargs(opts) | |
1376 |
ctx = |
|
1376 | ctx = logcmdutil.revsingle(repo, opts.get(b'rev'), None) | |
1377 |
|
1377 | |||
1378 | stages = [ |
|
1378 | stages = [ | |
1379 | (b'parsed', pycompat.identity), |
|
1379 | (b'parsed', pycompat.identity), |
@@ -912,6 +912,18 b' def _makenofollowfilematcher(repo, pats,' | |||||
912 | return None |
|
912 | return None | |
913 |
|
913 | |||
914 |
|
914 | |||
|
915 | def revsingle(repo, revspec, default=b'.', localalias=None): | |||
|
916 | """Resolves user-provided revset(s) into a single revision. | |||
|
917 | ||||
|
918 | This just wraps the lower-level scmutil.revsingle() in order to raise an | |||
|
919 | exception indicating user error. | |||
|
920 | """ | |||
|
921 | try: | |||
|
922 | return scmutil.revsingle(repo, revspec, default, localalias) | |||
|
923 | except error.RepoLookupError as e: | |||
|
924 | raise error.InputError(e.args[0], hint=e.hint) | |||
|
925 | ||||
|
926 | ||||
915 | def revpair(repo, revs): |
|
927 | def revpair(repo, revs): | |
916 | """Resolves user-provided revset(s) into two revisions. |
|
928 | """Resolves user-provided revset(s) into two revisions. | |
917 |
|
929 |
@@ -101,7 +101,7 b' typical client does not want echo-back m' | |||||
101 | 000000000000 tip |
|
101 | 000000000000 tip | |
102 | *** runcommand id -runknown |
|
102 | *** runcommand id -runknown | |
103 | abort: unknown revision 'unknown' |
|
103 | abort: unknown revision 'unknown' | |
104 |
[ |
|
104 | [10] | |
105 |
|
105 | |||
106 | >>> from hgclient import bprint, check, readchannel |
|
106 | >>> from hgclient import bprint, check, readchannel | |
107 | >>> @check |
|
107 | >>> @check |
@@ -75,7 +75,7 b' Testing with rev number' | |||||
75 | $ hg status --change 2 --config experimental.directaccess.revnums=False |
|
75 | $ hg status --change 2 --config experimental.directaccess.revnums=False | |
76 | abort: hidden revision '2' was rewritten as: 2443a0e66469 |
|
76 | abort: hidden revision '2' was rewritten as: 2443a0e66469 | |
77 | (use --hidden to access hidden revisions) |
|
77 | (use --hidden to access hidden revisions) | |
78 |
[ |
|
78 | [10] | |
79 |
|
79 | |||
80 | $ hg diff -c 2 |
|
80 | $ hg diff -c 2 | |
81 | diff -r 29becc82797a -r 28ad74487de9 c |
|
81 | diff -r 29becc82797a -r 28ad74487de9 c |
@@ -88,7 +88,7 b' The next two calls are expected to abort' | |||||
88 |
|
88 | |||
89 | $ hg manifest -r 2 |
|
89 | $ hg manifest -r 2 | |
90 | abort: unknown revision '2' |
|
90 | abort: unknown revision '2' | |
91 |
[ |
|
91 | [10] | |
92 |
|
92 | |||
93 | $ hg manifest -r tip tip |
|
93 | $ hg manifest -r tip tip | |
94 | abort: please specify just one revision |
|
94 | abort: please specify just one revision |
@@ -54,7 +54,7 b' Actual test' | |||||
54 | $ hg update 471f378eab4c |
|
54 | $ hg update 471f378eab4c | |
55 | abort: hidden revision '471f378eab4c' was rewritten as: 4ae3a4151de9 |
|
55 | abort: hidden revision '471f378eab4c' was rewritten as: 4ae3a4151de9 | |
56 | (use --hidden to access hidden revisions) |
|
56 | (use --hidden to access hidden revisions) | |
57 |
[ |
|
57 | [10] | |
58 | $ hg update --hidden "desc(A0)" |
|
58 | $ hg update --hidden "desc(A0)" | |
59 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
59 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
60 | updated to hidden changeset 471f378eab4c |
|
60 | updated to hidden changeset 471f378eab4c | |
@@ -118,7 +118,7 b' Actual test' | |||||
118 | $ hg up 0dec01379d3b |
|
118 | $ hg up 0dec01379d3b | |
119 | abort: hidden revision '0dec01379d3b' is pruned |
|
119 | abort: hidden revision '0dec01379d3b' is pruned | |
120 | (use --hidden to access hidden revisions) |
|
120 | (use --hidden to access hidden revisions) | |
121 |
[ |
|
121 | [10] | |
122 | $ hg up --hidden -r 'desc(B0)' |
|
122 | $ hg up --hidden -r 'desc(B0)' | |
123 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
123 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
124 | updated to hidden changeset 0dec01379d3b |
|
124 | updated to hidden changeset 0dec01379d3b | |
@@ -196,7 +196,7 b' Actual test' | |||||
196 | $ hg update 471597cad322 |
|
196 | $ hg update 471597cad322 | |
197 | abort: hidden revision '471597cad322' was split as: 337fec4d2edc, f257fde29c7a |
|
197 | abort: hidden revision '471597cad322' was split as: 337fec4d2edc, f257fde29c7a | |
198 | (use --hidden to access hidden revisions) |
|
198 | (use --hidden to access hidden revisions) | |
199 |
[ |
|
199 | [10] | |
200 | $ hg update --hidden 'min(desc(A0))' |
|
200 | $ hg update --hidden 'min(desc(A0))' | |
201 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
201 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
202 | updated to hidden changeset 471597cad322 |
|
202 | updated to hidden changeset 471597cad322 | |
@@ -296,7 +296,7 b' Actual test' | |||||
296 | $ hg update de7290d8b885 |
|
296 | $ hg update de7290d8b885 | |
297 | abort: hidden revision 'de7290d8b885' was split as: 337fec4d2edc, f257fde29c7a and 2 more |
|
297 | abort: hidden revision 'de7290d8b885' was split as: 337fec4d2edc, f257fde29c7a and 2 more | |
298 | (use --hidden to access hidden revisions) |
|
298 | (use --hidden to access hidden revisions) | |
299 |
[ |
|
299 | [10] | |
300 | $ hg update --hidden 'min(desc(A0))' |
|
300 | $ hg update --hidden 'min(desc(A0))' | |
301 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
301 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
302 | updated to hidden changeset de7290d8b885 |
|
302 | updated to hidden changeset de7290d8b885 | |
@@ -377,7 +377,7 b' Test setup' | |||||
377 | $ hg update 471f378eab4c |
|
377 | $ hg update 471f378eab4c | |
378 | abort: hidden revision '471f378eab4c' was rewritten as: eb5a0daa2192 |
|
378 | abort: hidden revision '471f378eab4c' was rewritten as: eb5a0daa2192 | |
379 | (use --hidden to access hidden revisions) |
|
379 | (use --hidden to access hidden revisions) | |
380 |
[ |
|
380 | [10] | |
381 | $ hg update --hidden 'desc(A0)' |
|
381 | $ hg update --hidden 'desc(A0)' | |
382 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
382 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
383 | updated to hidden changeset 471f378eab4c |
|
383 | updated to hidden changeset 471f378eab4c | |
@@ -385,7 +385,7 b' Test setup' | |||||
385 | $ hg update 0dec01379d3b |
|
385 | $ hg update 0dec01379d3b | |
386 | abort: hidden revision '0dec01379d3b' was rewritten as: eb5a0daa2192 |
|
386 | abort: hidden revision '0dec01379d3b' was rewritten as: eb5a0daa2192 | |
387 | (use --hidden to access hidden revisions) |
|
387 | (use --hidden to access hidden revisions) | |
388 |
[ |
|
388 | [10] | |
389 | $ hg update --hidden 'desc(B0)' |
|
389 | $ hg update --hidden 'desc(B0)' | |
390 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
390 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
391 | updated to hidden changeset 0dec01379d3b |
|
391 | updated to hidden changeset 0dec01379d3b | |
@@ -460,7 +460,7 b' Actual test' | |||||
460 | $ hg update 471f378eab4c |
|
460 | $ hg update 471f378eab4c | |
461 | abort: hidden revision '471f378eab4c' has diverged |
|
461 | abort: hidden revision '471f378eab4c' has diverged | |
462 | (use --hidden to access hidden revisions) |
|
462 | (use --hidden to access hidden revisions) | |
463 |
[ |
|
463 | [10] | |
464 | $ hg update --hidden 'desc(A0)' |
|
464 | $ hg update --hidden 'desc(A0)' | |
465 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
465 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
466 | updated to hidden changeset 471f378eab4c |
|
466 | updated to hidden changeset 471f378eab4c | |
@@ -557,7 +557,7 b' Test setup' | |||||
557 | $ hg update 471f378eab4c |
|
557 | $ hg update 471f378eab4c | |
558 | abort: hidden revision '471f378eab4c' was rewritten as: eb5a0daa2192 |
|
558 | abort: hidden revision '471f378eab4c' was rewritten as: eb5a0daa2192 | |
559 | (use --hidden to access hidden revisions) |
|
559 | (use --hidden to access hidden revisions) | |
560 |
[ |
|
560 | [10] | |
561 | $ hg update --hidden 'desc(A0)' |
|
561 | $ hg update --hidden 'desc(A0)' | |
562 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
562 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
563 | updated to hidden changeset 471f378eab4c |
|
563 | updated to hidden changeset 471f378eab4c |
@@ -162,7 +162,7 b' Multiple destinations cannot be used wit' | |||||
162 | > A D |
|
162 | > A D | |
163 | > EOS |
|
163 | > EOS | |
164 | abort: unknown revision 'SRC' |
|
164 | abort: unknown revision 'SRC' | |
165 |
[ |
|
165 | [10] | |
166 |
|
166 | |||
167 | Rebase to null should work: |
|
167 | Rebase to null should work: | |
168 |
|
168 |
@@ -709,7 +709,7 b' test hg strip -B bookmark' | |||||
709 | bookmark 'todelete' deleted |
|
709 | bookmark 'todelete' deleted | |
710 | $ hg id -ir dcbb326fdec2 |
|
710 | $ hg id -ir dcbb326fdec2 | |
711 | abort: unknown revision 'dcbb326fdec2' |
|
711 | abort: unknown revision 'dcbb326fdec2' | |
712 |
[ |
|
712 | [10] | |
713 | $ hg id -ir d62d843c9a01 |
|
713 | $ hg id -ir d62d843c9a01 | |
714 | d62d843c9a01 |
|
714 | d62d843c9a01 | |
715 | $ hg bookmarks |
|
715 | $ hg bookmarks | |
@@ -725,17 +725,17 b' test hg strip -B bookmark' | |||||
725 | bookmark 'multipledelete2' deleted |
|
725 | bookmark 'multipledelete2' deleted | |
726 | $ hg id -ir e46a4836065c |
|
726 | $ hg id -ir e46a4836065c | |
727 | abort: unknown revision 'e46a4836065c' |
|
727 | abort: unknown revision 'e46a4836065c' | |
728 |
[ |
|
728 | [10] | |
729 | $ hg id -ir b4594d867745 |
|
729 | $ hg id -ir b4594d867745 | |
730 | abort: unknown revision 'b4594d867745' |
|
730 | abort: unknown revision 'b4594d867745' | |
731 |
[ |
|
731 | [10] | |
732 | $ hg strip -B singlenode1 -B singlenode2 |
|
732 | $ hg strip -B singlenode1 -B singlenode2 | |
733 | saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/43227190fef8-8da858f2-backup.hg |
|
733 | saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/43227190fef8-8da858f2-backup.hg | |
734 | bookmark 'singlenode1' deleted |
|
734 | bookmark 'singlenode1' deleted | |
735 | bookmark 'singlenode2' deleted |
|
735 | bookmark 'singlenode2' deleted | |
736 | $ hg id -ir 43227190fef8 |
|
736 | $ hg id -ir 43227190fef8 | |
737 | abort: unknown revision '43227190fef8' |
|
737 | abort: unknown revision '43227190fef8' | |
738 |
[ |
|
738 | [10] | |
739 | $ hg strip -B unknownbookmark |
|
739 | $ hg strip -B unknownbookmark | |
740 | abort: bookmark 'unknownbookmark' not found |
|
740 | abort: bookmark 'unknownbookmark' not found | |
741 | [255] |
|
741 | [255] | |
@@ -750,7 +750,7 b' test hg strip -B bookmark' | |||||
750 | bookmark 'delete' deleted |
|
750 | bookmark 'delete' deleted | |
751 | $ hg id -ir 6:2702dd0c91e7 |
|
751 | $ hg id -ir 6:2702dd0c91e7 | |
752 | abort: unknown revision '2702dd0c91e7' |
|
752 | abort: unknown revision '2702dd0c91e7' | |
753 |
[ |
|
753 | [10] | |
754 | $ hg update B |
|
754 | $ hg update B | |
755 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
755 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
756 | (activating bookmark B) |
|
756 | (activating bookmark B) |
General Comments 0
You need to be logged in to leave comments.
Login now