class documentation

Find the objects missing from another object store.

Parameters
object_storeObject store containing at least all objects to be sent
havesSHA1s of commits not to send (already present in target)
wantsSHA1s of commits to send
progressOptional function to report progress to.
get_taggedFunction that returns a dict of pointed-to sha -> tag sha for including tags.
get_parentsOptional function for getting the parents of a commit.
Method __init__ Initialize a MissingObjectFinder.
Method __iter__ Return iterator over objects to send.
Method __next__ Get the next object to send.
Method add_todo Add objects to the todo list.
Method get_remote_has Get the set of SHAs the remote has.
Instance Variable object_store Undocumented
Instance Variable objects_to_send Undocumented
Instance Variable progress Undocumented
Instance Variable remote_has Undocumented
Instance Variable sha_done Undocumented
Instance Variable _get_parents Undocumented
Instance Variable _tagged Undocumented
def __init__(self, object_store: BaseObjectStore, haves: Iterable[ObjectID], wants: Iterable[ObjectID], *, shallow: Set[ObjectID] | None = None, progress: Callable[[bytes], None] | None = None, get_tagged: Callable[[], dict[ObjectID, ObjectID]] | None = None, get_parents: Callable[[Commit], list[ObjectID]] = lambda commit: commit.parents):

Initialize a MissingObjectFinder.

Parameters
object_store:BaseObjectStoreObject store containing objects
haves:Iterable[ObjectID]SHA1s of objects already present in target
wants:Iterable[ObjectID]SHA1s of objects to send
shallow:Set[ObjectID] | NoneSet of shallow commit SHA1s
progress:Callable[[bytes], None] | NoneOptional progress reporting callback
get_tagged:Callable[[], dict[ObjectID, ObjectID]] | NoneFunction returning dict of pointed-to sha -> tag sha
get_parents:Callable[[Commit], list[ObjectID]]Function for getting commit parents
def __iter__(self) -> Iterator[tuple[ObjectID, PackHint | None]]:

Return iterator over objects to send.

Returns
Iterator[tuple[ObjectID, PackHint | None]]Self (this class implements the iterator protocol)
def __next__(self) -> tuple[ObjectID, PackHint | None]:

Get the next object to send.

Returns
tuple[ObjectID, PackHint | None]Tuple of (sha, pack_hint)
Raises
StopIterationWhen no more objects to send
def add_todo(self, entries: Iterable[tuple[ObjectID, bytes | None, int | None, bool]]):

Add objects to the todo list.

Parameters
entries:Iterable[tuple[ObjectID, bytes | None, int | None, bool]]Iterable of tuples (sha, name, type_num, is_leaf)
def get_remote_has(self) -> set[ObjectID]:

Get the set of SHAs the remote has.

Returns
set[ObjectID]Set of SHA1s that the remote side already has
object_store =

Undocumented

objects_to_send: set[tuple[ObjectID, bytes | None, int | None, bool]] =

Undocumented

progress: Callable[[bytes], None] =

Undocumented

remote_has: set[ObjectID] =

Undocumented

sha_done =

Undocumented

_get_parents =

Undocumented

_tagged =

Undocumented