##// END OF EJS Templates
errors: use InputError for some invalid revsets and such...
Martin von Zweigbergk -
r48844:7d908ee1 default
parent child Browse files
Show More
@@ -1081,7 +1081,7 b' def bisect('
1081 raise error.StateError(_(b'current bisect revision is a merge'))
1081 raise error.StateError(_(b'current bisect revision is a merge'))
1082 if rev:
1082 if rev:
1083 if not nodes:
1083 if not nodes:
1084 raise error.Abort(_(b'empty revision set'))
1084 raise error.InputError(_(b'empty revision set'))
1085 node = repo[nodes[-1]].node()
1085 node = repo[nodes[-1]].node()
1086 with hbisect.restore_state(repo, state, node):
1086 with hbisect.restore_state(repo, state, node):
1087 while changesets:
1087 while changesets:
@@ -689,7 +689,7 b" def revsingle(repo, revspec, default=b'."
689
689
690 l = revrange(repo, [revspec], localalias=localalias)
690 l = revrange(repo, [revspec], localalias=localalias)
691 if not l:
691 if not l:
692 raise error.Abort(_(b'empty revision set'))
692 raise error.InputError(_(b'empty revision set'))
693 return repo[l.last()]
693 return repo[l.last()]
694
694
695
695
@@ -710,7 +710,7 b' def revpair(repo, revs):'
710 l = revrange(repo, revs)
710 l = revrange(repo, revs)
711
711
712 if not l:
712 if not l:
713 raise error.Abort(_(b'empty revision range'))
713 raise error.InputError(_(b'empty revision range'))
714
714
715 first = l.first()
715 first = l.first()
716 second = l.last()
716 second = l.last()
@@ -720,7 +720,7 b' def revpair(repo, revs):'
720 and len(revs) >= 2
720 and len(revs) >= 2
721 and not all(revrange(repo, [r]) for r in revs)
721 and not all(revrange(repo, [r]) for r in revs)
722 ):
722 ):
723 raise error.Abort(_(b'empty revision on one side of range'))
723 raise error.InputError(_(b'empty revision on one side of range'))
724
724
725 # if top-level is range expression, the result must always be a pair
725 # if top-level is range expression, the result must always be a pair
726 if first == second and len(revs) == 1 and not _pairspec(revs[0]):
726 if first == second and len(revs) == 1 and not _pairspec(revs[0]):
@@ -119,7 +119,7 b' as pairs even if x == y, but not for "f('
119 +wdir
119 +wdir
120 $ hg diff -r "2 and 1"
120 $ hg diff -r "2 and 1"
121 abort: empty revision range
121 abort: empty revision range
122 [255]
122 [10]
123
123
124 $ cd ..
124 $ cd ..
125
125
@@ -87,7 +87,7 b' Specifying an empty revision should abor'
87
87
88 $ hg extdiff -p diff --patch --rev 'ancestor()' --rev 1
88 $ hg extdiff -p diff --patch --rev 'ancestor()' --rev 1
89 abort: empty revision on one side of range
89 abort: empty revision on one side of range
90 [255]
90 [10]
91
91
92 Test diff during merge:
92 Test diff during merge:
93
93
@@ -132,7 +132,7 b' These fail:'
132
132
133 $ hg rebase --dest '1 & !1'
133 $ hg rebase --dest '1 & !1'
134 abort: empty revision set
134 abort: empty revision set
135 [255]
135 [10]
136
136
137 These work:
137 These work:
138
138
@@ -840,7 +840,7 b' test usage in revpair (with "+")'
840
840
841 $ hg diff -r 'author("babar") or author("celeste")'
841 $ hg diff -r 'author("babar") or author("celeste")'
842 abort: empty revision range
842 abort: empty revision range
843 [255]
843 [10]
844
844
845 aliases:
845 aliases:
846
846
General Comments 0
You need to be logged in to leave comments. Login now