class documentation

class BisectState:

Constructor: BisectState(repo)

View In Hierarchy

Manages the state of a bisect session.

Method __init__ Initialize BisectState.
Method get_log Get the bisect log.
Method mark_bad Mark a commit as bad.
Method mark_good Mark a commit as good.
Method replay Replay a bisect log.
Method reset Reset bisect state and return to original branch/commit.
Method skip Skip one or more commits.
Method start Start a new bisect session.
Instance Variable repo Undocumented
Property is_active Check if a bisect session is active.
Method _append_to_log Append a line to the bisect log.
Method _estimate_steps Estimate the number of steps remaining in bisect.
Method _find_bisect_candidates Find all commits between good and bad commits.
Method _find_next_commit Find the next commit to test using binary search.
Method _get_commit_subject Get the subject line of a commit message.
Instance Variable _bisect_dir Undocumented
def __init__(self, repo: Repo):

Initialize BisectState.

Parameters
repo:RepoRepository to perform bisect on
def get_log(self) -> str:

Get the bisect log.

def mark_bad(self, rev: ObjectID | None = None) -> ObjectID | None:

Mark a commit as bad.

Parameters
rev:ObjectID | NoneCommit SHA to mark as bad (defaults to HEAD)
Returns
ObjectID | NoneThe SHA of the next commit to test, or None if bisect is complete
def mark_good(self, rev: ObjectID | None = None) -> ObjectID | None:

Mark a commit as good.

Parameters
rev:ObjectID | NoneCommit SHA to mark as good (defaults to HEAD)
Returns
ObjectID | NoneThe SHA of the next commit to test, or None if bisect is complete
def replay(self, log_content: str):

Replay a bisect log.

Parameters
log_content:strThe bisect log content to replay
def reset(self, commit: ObjectID | None = None):

Reset bisect state and return to original branch/commit.

Parameters
commit:ObjectID | NoneOptional commit to reset to (defaults to original branch/commit)
def skip(self, revs: Sequence[ObjectID] | None = None) -> ObjectID | None:

Skip one or more commits.

Parameters
revs:Sequence[ObjectID] | NoneList of commits to skip (defaults to [HEAD])
Returns
ObjectID | NoneThe SHA of the next commit to test, or None if bisect is complete
def start(self, bad: ObjectID | None = None, good: Sequence[ObjectID] | None = None, paths: Sequence[bytes] | None = None, no_checkout: bool = False, term_bad: str = 'bad', term_good: str = 'good'):

Start a new bisect session.

Parameters
bad:ObjectID | NoneThe bad commit SHA (defaults to HEAD)
good:Sequence[ObjectID] | NoneList of good commit SHAs
paths:Sequence[bytes] | NoneOptional paths to limit bisect to
no_checkout:boolIf True, don't checkout commits during bisect
term_bad:strTerm to use for bad commits (default: "bad")
term_good:strTerm to use for good commits (default: "good")
repo =

Undocumented

is_active: bool =

Check if a bisect session is active.

def _append_to_log(self, line: str):

Append a line to the bisect log.

def _estimate_steps(self, num_candidates: int) -> int:

Estimate the number of steps remaining in bisect.

def _find_bisect_candidates(self, bad_sha: ObjectID, good_shas: Sequence[ObjectID], skip_shas: Set[ObjectID]) -> list[ObjectID]:

Find all commits between good and bad commits.

Parameters
bad_sha:ObjectIDThe bad commit SHA
good_shas:Sequence[ObjectID]List of good commit SHAs
skip_shas:Set[ObjectID]Set of commits to skip
Returns
list[ObjectID]List of candidate commit SHAs in topological order
def _find_next_commit(self) -> ObjectID | None:

Find the next commit to test using binary search.

Returns
ObjectID | NoneThe SHA of the next commit to test, or None if bisect is complete
def _get_commit_subject(self, sha: ObjectID) -> str:

Get the subject line of a commit message.

_bisect_dir =

Undocumented