class documentation

class Rebaser:

Constructor: Rebaser(repo)

View In Hierarchy

Handles git rebase operations.

Method __init__ Initialize rebaser.
Method abort Abort an in-progress rebase and restore original state.
Method continue_ Continue an in-progress rebase.
Method is_in_progress Check if a rebase is currently in progress.
Method start Start a rebase.
Instance Variable object_store Undocumented
Instance Variable repo Undocumented
Method _cherry_pick Cherry-pick a commit onto another commit.
Method _clean_rebase_state Clean up rebase state files.
Method _finish_rebase Finish rebase by updating HEAD and cleaning up.
Method _get_commits_to_rebase Get list of commits to rebase.
Method _load_rebase_state Load existing rebase state if present.
Method _save_rebase_state Save rebase state to allow resuming.
Instance Variable _done Undocumented
Instance Variable _onto Undocumented
Instance Variable _original_head Undocumented
Instance Variable _rebasing_branch Undocumented
Instance Variable _state_manager Undocumented
Instance Variable _todo Undocumented
def __init__(self, repo: Repo):

Initialize rebaser.

Parameters
repo:RepoRepository to perform rebase in
def abort(self):

Abort an in-progress rebase and restore original state.

def continue_(self) -> tuple[bytes, list[bytes]] | None:

Continue an in-progress rebase.

Returns
tuple[bytes, list[bytes]] | NoneNone if rebase is complete, or tuple of (commit_sha, conflicts) for next commit
def is_in_progress(self) -> bool:

Check if a rebase is currently in progress.

def start(self, upstream: bytes, onto: bytes | None = None, branch: bytes | None = None) -> list[Commit]:

Start a rebase.

Parameters
upstream:bytesUpstream branch/commit to rebase onto
onto:bytes | NoneSpecific commit to rebase onto (defaults to upstream)
branch:bytes | NoneBranch to rebase (defaults to current branch)
Returns
list[Commit]List of commits that will be rebased
object_store =

Undocumented

repo =

Undocumented

def _cherry_pick(self, commit: Commit, onto: ObjectID) -> tuple[ObjectID | None, list[bytes]]:

Cherry-pick a commit onto another commit.

Parameters
commit:CommitCommit to cherry-pick
onto:ObjectIDSHA of commit to cherry-pick onto
Returns
tuple[ObjectID | None, list[bytes]]Tuple of (new_commit_sha, list_of_conflicted_files)
def _clean_rebase_state(self):

Clean up rebase state files.

def _finish_rebase(self):

Finish rebase by updating HEAD and cleaning up.

def _get_commits_to_rebase(self, upstream: bytes, branch: bytes | None = None) -> list[Commit]:

Get list of commits to rebase.

Parameters
upstream:bytesUpstream commit/branch to rebase onto
branch:bytes | NoneBranch to rebase (defaults to current branch)
Returns
list[Commit]List of commits to rebase in chronological order
def _load_rebase_state(self):

Load existing rebase state if present.

def _save_rebase_state(self):

Save rebase state to allow resuming.

_done: list[Commit] =

Undocumented

_onto: ObjectID | None =

Undocumented

_original_head: bytes | None =

Undocumented

_rebasing_branch: Ref | None =

Undocumented

_state_manager =

Undocumented

_todo: list[Commit] =

Undocumented