Commit 85cea0a9 authored by Martin von Zweigbergk's avatar Martin von Zweigbergk

errors: raise StateError in `hg bisect`

Differential Revision: https://phab.mercurial-scm.org/D9337
parent 1a72e4839795
......@@ -172,13 +172,13 @@ def resetstate(repo):
def checkstate(state):
"""check we have both 'good' and 'bad' to define a range
Raise Abort exception otherwise."""
Raise StateError exception otherwise."""
if state[b'good'] and state[b'bad']:
return True
if not state[b'good']:
raise error.Abort(_(b'cannot bisect (no known good revisions)'))
raise error.StateError(_(b'cannot bisect (no known good revisions)'))
else:
raise error.Abort(_(b'cannot bisect (no known bad revisions)'))
raise error.StateError(_(b'cannot bisect (no known bad revisions)'))
@contextlib.contextmanager
......
......@@ -364,7 +364,7 @@ test no action
$ hg bisect -r
$ hg bisect
abort: cannot bisect (no known good revisions)
[255]
[20]
reproduce AssertionError, issue1445
......@@ -475,7 +475,7 @@ test bisecting command
$ hg bisect --command "\"$PYTHON\" \"$TESTTMP/script.py\" and some parameters"
changeset 31:58c80a7c8a40: good
abort: cannot bisect (no known bad revisions)
[255]
[20]
$ hg up -qr 0
$ hg bisect --command "\"$PYTHON\" \"$TESTTMP/script.py\" and some parameters"
changeset 0:b99c7b9c8e11: bad
......@@ -545,7 +545,7 @@ test the same case, this time with updating
$ hg bisect --command "sh \"$TESTTMP/script.sh\" and some params"
changeset 31:58c80a7c8a40: good
abort: cannot bisect (no known bad revisions)
[255]
[20]
$ hg up -qr 0
$ hg bisect --command "sh \"$TESTTMP/script.sh\" and some params"
changeset 0:b99c7b9c8e11: bad
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment