Show More
@@ -101,6 +101,7 b' from mercurial import (' | |||||
101 | error, |
|
101 | error, | |
102 | filemerge, |
|
102 | filemerge, | |
103 | formatter, |
|
103 | formatter, | |
|
104 | logcmdutil, | |||
104 | pycompat, |
|
105 | pycompat, | |
105 | registrar, |
|
106 | registrar, | |
106 | scmutil, |
|
107 | scmutil, | |
@@ -568,7 +569,7 b' def dodiff(ui, repo, cmdline, pats, opts' | |||||
568 | ctx1b = repo[nullrev] |
|
569 | ctx1b = repo[nullrev] | |
569 | ctx2 = scmutil.revsingle(repo, to_rev, None) |
|
570 | ctx2 = scmutil.revsingle(repo, to_rev, None) | |
570 | else: |
|
571 | else: | |
571 |
ctx1a, ctx2 = |
|
572 | ctx1a, ctx2 = logcmdutil.revpair(repo, revs) | |
572 | if not revs: |
|
573 | if not revs: | |
573 | ctx1b = repo[None].p2() |
|
574 | ctx1b = repo[None].p2() | |
574 | else: |
|
575 | else: |
@@ -2610,7 +2610,7 b' def diff(ui, repo, *pats, **opts):' | |||||
2610 | ctx2 = scmutil.revsingle(repo, to_rev, None) |
|
2610 | ctx2 = scmutil.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 = |
|
2613 | ctx1, ctx2 = logcmdutil.revpair(repo, revs) | |
2614 |
|
2614 | |||
2615 | if reverse: |
|
2615 | if reverse: | |
2616 | ctxleft = ctx2 |
|
2616 | ctxleft = ctx2 | |
@@ -6909,7 +6909,7 b' def status(ui, repo, *pats, **opts):' | |||||
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') | |
6912 |
ctx1, ctx2 = |
|
6912 | ctx1, ctx2 = logcmdutil.revpair(repo, revs) | |
6913 |
|
6913 | |||
6914 | forcerelativevalue = None |
|
6914 | forcerelativevalue = None | |
6915 | if ui.hasconfig(b'commands', b'status.relative'): |
|
6915 | if ui.hasconfig(b'commands', b'status.relative'): |
@@ -912,6 +912,18 b' def _makenofollowfilematcher(repo, pats,' | |||||
912 | return None |
|
912 | return None | |
913 |
|
913 | |||
914 |
|
914 | |||
|
915 | def revpair(repo, revs): | |||
|
916 | """Resolves user-provided revset(s) into two revisions. | |||
|
917 | ||||
|
918 | This just wraps the lower-level scmutil.revpair() in order to raise an | |||
|
919 | exception indicating user error. | |||
|
920 | """ | |||
|
921 | try: | |||
|
922 | return scmutil.revpair(repo, revs) | |||
|
923 | except error.RepoLookupError as e: | |||
|
924 | raise error.InputError(e.args[0], hint=e.hint) | |||
|
925 | ||||
|
926 | ||||
915 | def revrange(repo, specs, localalias=None): |
|
927 | def revrange(repo, specs, localalias=None): | |
916 | """Resolves user-provided revset(s). |
|
928 | """Resolves user-provided revset(s). | |
917 |
|
929 |
@@ -4,6 +4,7 b' from __future__ import absolute_import' | |||||
4 |
|
4 | |||
5 | from mercurial import ( |
|
5 | from mercurial import ( | |
6 | error, |
|
6 | error, | |
|
7 | logcmdutil, | |||
7 | patch, |
|
8 | patch, | |
8 | pycompat, |
|
9 | pycompat, | |
9 | registrar, |
|
10 | registrar, | |
@@ -49,7 +50,7 b' def autodiff(ui, repo, *pats, **opts):' | |||||
49 | else: |
|
50 | else: | |
50 | raise error.Abort(b'--git must be yes, no or auto') |
|
51 | raise error.Abort(b'--git must be yes, no or auto') | |
51 |
|
52 | |||
52 |
ctx1, ctx2 = |
|
53 | ctx1, ctx2 = logcmdutil.revpair(repo, []) | |
53 | m = scmutil.match(ctx2, pats, opts) |
|
54 | m = scmutil.match(ctx2, pats, opts) | |
54 | it = patch.diff( |
|
55 | it = patch.diff( | |
55 | repo, |
|
56 | repo, |
General Comments 0
You need to be logged in to leave comments.
Login now