module documentation

Git object store interfaces and implementation.

Class BaseObjectStore Object store interface.
Class BucketBasedObjectStore Object store implementation that uses a bucket store like S3 as backend.
Class DiskObjectStore Git-style object store that exists on disk.
Class MemoryObjectStore Object store that keeps all objects in memory.
Class MissingObjectFinder Find the objects missing from another object store.
Class ObjectIterator Interface for iterating over objects.
Class ObjectStoreGraphWalker Graph walker that finds what commits are missing from an object store.
Class ObjectStoreIterator ObjectIterator that works on top of an ObjectStore.
Class OverlayObjectStore Object store that can overlay multiple object stores.
Class PackBasedObjectStore No class docstring; 1/2 property, 0/2 instance variable, 11/19 methods documented
Function commit_tree_changes Commit a specified set of changes to a tree structure.
Function read_packs_file Yield the packs listed in a packs file.
Function tree_lookup_path Look up an object in a Git tree.
Constant INFODIR Undocumented
Constant PACK_MODE Undocumented
Constant PACKDIR Undocumented
Function _collect_filetree_revs Collect SHA1s of files and directories for specified tree.
Function _split_commits_and_tags Split object id list into three lists with commit, tag, and other SHAs.
def commit_tree_changes(object_store, tree, changes):

Commit a specified set of changes to a tree structure.

This will apply a set of changes on top of an existing tree, storing new objects in object_store.

changes are a list of tuples with (path, mode, object_sha). Paths can be both blobs and trees. See the mode and object sha to None deletes the path.

This method works especially well if there are only a small number of changes to a big tree. For a large number of changes to a large tree, use e.g. commit_tree.

Returns: New tree root object

Parameters
object_storeObject store to store new objects in and retrieve old ones from.
treeOriginal tree root
changeschanges to apply
def read_packs_file(f):

Yield the packs listed in a packs file.

def tree_lookup_path(lookup_obj, root_sha, path):

Look up an object in a Git tree.

Returns: A tuple of (mode, SHA) of the resulting path.

Parameters
lookup_objCallback for retrieving object by SHA1
root_shaSHA1 of the root tree
pathPath to lookup
INFODIR: str =

Undocumented

Value
'info'
PACK_MODE =

Undocumented

Value
(292 if sys.platform != 'win32' else 420)
PACKDIR: str =

Undocumented

Value
'pack'
def _collect_filetree_revs(obj_store, tree_sha, kset):

Collect SHA1s of files and directories for specified tree.

Parameters
obj_storeObject store to get objects by SHA from
tree_shatree reference to walk
ksetset to fill with references to files and directories
def _split_commits_and_tags(obj_store, lst, ignore_unknown=False):

Split object id list into three lists with commit, tag, and other SHAs.

Commits referenced by tags are included into commits list as well. Only SHA1s known in this repository will get through, and unless ignore_unknown argument is True, KeyError is thrown for SHA1 missing in the repository

Returns: A tuple of (commits, tags, others) SHA1s

Parameters
obj_storeObject store to get objects by SHA1 from
lstCollection of commit and tag SHAs
ignore_unknownTrue to skip SHA1 missing in the repository silently.