mirror of
https://github.com/facebook/sapling.git
synced 2024-10-05 14:28:17 +03:00
bisect: abstract a separate for updating state
Summary: we will update this function in the following diffs, abstract it to a separate function will avoid making the main function too complex Reviewed By: muirdm Differential Revision: D46643577 fbshipit-source-id: 227e0b60fe2efa1d6d00fa409ea95a30cc972747
This commit is contained in:
parent
cbee0a7aaf
commit
9772bf3c76
@ -1001,16 +1001,7 @@ def bisect(
|
||||
|
||||
# update state
|
||||
if good or bad or skip:
|
||||
if rev:
|
||||
nodes = [repo.lookup(i) for i in scmutil.revrange(repo, [rev])]
|
||||
else:
|
||||
nodes = [repo.lookup(".")]
|
||||
if good:
|
||||
state["good"] += nodes
|
||||
elif bad:
|
||||
state["bad"] += nodes
|
||||
elif skip:
|
||||
state["skip"] += nodes
|
||||
_update_state(repo, state, rev, good, bad, skip)
|
||||
hbisect.save_state(repo, state)
|
||||
if not (state["good"] and state["bad"]):
|
||||
return
|
||||
@ -1182,6 +1173,19 @@ the sparse profile from the known %s changeset %s\n"
|
||||
return mayupdate(repo, node)
|
||||
|
||||
|
||||
def _update_state(repo, state, rev, good, bad, skip):
|
||||
if rev:
|
||||
nodes = [repo.lookup(i) for i in scmutil.revrange(repo, [rev])]
|
||||
else:
|
||||
nodes = [repo.lookup(".")]
|
||||
if good:
|
||||
state["good"] += nodes
|
||||
elif bad:
|
||||
state["bad"] += nodes
|
||||
elif skip:
|
||||
state["skip"] += nodes
|
||||
|
||||
|
||||
@command(
|
||||
"bookmark|bo|book",
|
||||
[
|
||||
|
Loading…
Reference in New Issue
Block a user