class documentation

class DiskAmStateManager:

Constructor: DiskAmStateManager(path)

View In Hierarchy

Manages git am state on disk in .git/rebase-apply/.

Follows the same file layout as C git.

Method __init__ Initialize with the path to the rebase-apply directory.
Method clean Remove the state directory.
Method exists Check if am state directory exists.
Method get_keep_non_patch Return whether only [PATCH] is stripped from brackets.
Method get_keep_subject Return whether subject munging is disabled.
Method get_last Return the total number of patches.
Method get_message_id Return whether Message-ID inclusion is enabled.
Method get_next Return the 1-based index of the current patch.
Method get_orig_head Return the original HEAD sha from before am started.
Method get_patch Return the raw email bytes for the given patch number.
Method get_scissors Return whether scissors line handling is enabled.
Method get_strip Return the number of path components to strip.
Method get_three_way Return whether three-way merge fallback is enabled.
Method load_author_info Load saved author metadata for the current patch.
Method load_message Load the saved commit message for the current patch.
Method save_author_info Save author metadata for the current patch.
Method save_initial Initialize state directory with patches and options.
Method save_message Save the commit message for the current patch.
Method set_next Set the current patch index.
Instance Variable path Undocumented
Method _has_file Undocumented
Method _read_file Undocumented
Method _write_file Undocumented
def __init__(self, path: str):

Initialize with the path to the rebase-apply directory.

def clean(self):

Remove the state directory.

def exists(self) -> bool:

Check if am state directory exists.

def get_keep_non_patch(self) -> bool:

Return whether only [PATCH] is stripped from brackets.

def get_keep_subject(self) -> bool:

Return whether subject munging is disabled.

def get_last(self) -> int:

Return the total number of patches.

def get_message_id(self) -> bool:

Return whether Message-ID inclusion is enabled.

def get_next(self) -> int:

Return the 1-based index of the current patch.

def get_orig_head(self) -> ObjectID:

Return the original HEAD sha from before am started.

def get_patch(self, number: int) -> bytes:

Return the raw email bytes for the given patch number.

def get_scissors(self) -> bool:

Return whether scissors line handling is enabled.

def get_strip(self) -> int:

Return the number of path components to strip.

def get_three_way(self) -> bool:

Return whether three-way merge fallback is enabled.

def load_author_info(self) -> tuple[str, str, str | None]:

Load saved author metadata for the current patch.

def load_message(self) -> bytes:

Load the saved commit message for the current patch.

def save_author_info(self, name: str, email_addr: str, date: str | None):

Save author metadata for the current patch.

def save_initial(self, orig_head: bytes, msg_bytes_list: list[bytes], *, three_way: bool = False, keep_subject: bool = False, keep_non_patch: bool = False, scissors: bool = False, message_id: bool = False, strip: int = 1):

Initialize state directory with patches and options.

def save_message(self, message: bytes):

Save the commit message for the current patch.

def set_next(self, value: int):

Set the current patch index.

path =

Undocumented

def _has_file(self, name: str) -> bool:

Undocumented

def _read_file(self, name: str, strip: bool = True) -> bytes | None:

Undocumented

def _write_file(self, name: str, content: bytes):

Undocumented