class documentation

class GitFastExporter:

Constructor: GitFastExporter(outf, store)

View In Hierarchy

Generate a fast-export output stream for Git objects.

Method __init__ Initialize the fast exporter.
Method emit_blob Emit a blob to the output stream.
Method emit_commit Emit a commit in fast-export format.
Method print_cmd Print a command to the output stream.
Instance Variable markers Undocumented
Instance Variable outf Undocumented
Instance Variable store Undocumented
Method _allocate_marker Allocate a new marker.
Method _export_blob Export a blob object.
Method _export_commit Undocumented
Method _iter_files Undocumented
Instance Variable _marker_idx Undocumented
def __init__(self, outf: BinaryIO, store: BaseObjectStore):

Initialize the fast exporter.

Parameters
outf:BinaryIOOutput file to write to
store:BaseObjectStoreObject store to export from
def emit_blob(self, blob: Blob) -> bytes:

Emit a blob to the output stream.

Parameters
blob:BlobBlob object to emit
Returns
bytesMarker for the blob
def emit_commit(self, commit: Commit, ref: Ref, base_tree: ObjectID | None = None) -> bytes:

Emit a commit in fast-export format.

Parameters
commit:CommitCommit object to export
ref:RefReference name for the commit
base_tree:ObjectID | NoneBase tree for incremental export
Returns
bytesMarker for the commit
def print_cmd(self, cmd: object):

Print a command to the output stream.

Parameters
cmd:objectCommand object to print
markers: dict[bytes, ObjectID] =

Undocumented

outf =

Undocumented

store =

Undocumented

def _allocate_marker(self) -> bytes:

Allocate a new marker.

Returns
bytesNew marker as bytes
def _export_blob(self, blob: Blob) -> tuple[Any, bytes]:

Export a blob object.

Parameters
blob:BlobBlob object to export
Returns
tuple[Any, bytes]Tuple of (BlobCommand, marker)
def _export_commit(self, commit: Commit, ref: Ref, base_tree: ObjectID | None = None) -> tuple[Any, bytes]:

Undocumented

def _iter_files(self, base_tree: ObjectID | None, new_tree: ObjectID | None) -> Generator[Any, None, None]:

Undocumented

_marker_idx: int =

Undocumented