Known subclasses: dulwich.object_store.MemoryObjectStore, dulwich.object_store.OverlayObjectStore, dulwich.object_store.PackBasedObjectStore

Object store interface.
Method determine_wants_all Undocumented
Method iter_shas Iterate over the objects for the specified shas.
Method contains_loose Check if a particular object is present by SHA1 and is loose.
Method contains_packed Check if a particular object is present by SHA1 and is packed.
Method __contains__ Check if a particular object is present by SHA1.
Method packs Iterable of pack objects.
Method get_raw Obtain the raw text for an object.
Method __getitem__ Obtain an object by SHA1.
Method __iter__ Iterate over the SHAs that are present in this store.
Method add_object Add a single object to this object store.
Method add_objects Add a set of objects to this object store.
Method add_pack_data Add pack data to this object store.
Method tree_changes Find the differences between the contents of two trees
Method iter_tree_contents Iterate the contents of a tree and all subtrees.
Method find_missing_objects Find the missing objects required for a set of revisions.
Method find_common_revisions Find which revisions this store has in common using graphwalker.
Method generate_pack_contents Iterate over the contents of a pack file.
Method generate_pack_data Generate pack data objects for a set of wants/haves.
Method peel_sha Peel all tags from a SHA.
Method close Close any files opened by this object store.
Method _collect_ancestors Collect all ancestors of heads up to (excluding) those in common.
def determine_wants_all(self, refs):
Undocumented
def iter_shas(self, shas):
Iterate over the objects for the specified shas.
ParametersshasIterable object with SHAs
ReturnsObject iterator
def contains_loose(self, sha):
Check if a particular object is present by SHA1 and is loose.
def contains_packed(self, sha):
Check if a particular object is present by SHA1 and is packed.
def __contains__(self, sha):

Check if a particular object is present by SHA1.

This method makes no distinction between loose and packed objects.

def get_raw(self, name):
Obtain the raw text for an object.
Parametersnamesha for the object.
Returnstuple with numeric type and object contents.
def __getitem__(self, sha):
Obtain an object by SHA1.
def __iter__(self):
def add_objects(self, objects, progress=None):
Add a set of objects to this object store.
ParametersobjectsIterable over a list of (object, path) tuples
def add_pack_data(self, count, pack_data, progress=None):
Add pack data to this object store.
Parametersnum_itemsNumber of items to add
pack_dataIterator over pack data tuples
def tree_changes(self, source, target, want_unchanged=False, include_trees=False, change_type_same=False):
Find the differences between the contents of two trees
ParameterssourceSHA1 of the source tree
targetSHA1 of the target tree
want_unchangedWhether unchanged files should be reported
include_treesWhether to include trees
change_type_sameWhether to report files changing type in the same entry.
ReturnsIterator over tuples with (oldpath, newpath), (oldmode, newmode), (oldsha, newsha)
def iter_tree_contents(self, tree_id, include_trees=False):

Iterate the contents of a tree and all subtrees.

Iteration is depth-first pre-order, as in e.g. os.walk.

Parameterstree_idSHA1 of the tree.
include_treesIf True, include tree objects in the iteration.
ReturnsIterator over TreeEntry namedtuples for all the objects in a tree.
def find_missing_objects(self, haves, wants, progress=None, get_tagged=None, get_parents=lambda commit: commit.parents, depth=None):
Find the missing objects required for a set of revisions.
ParametershavesIterable over SHAs already in common.
wantsIterable over SHAs of objects to fetch.
progressSimple progress function that will be called with updated progress strings.
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.
ReturnsIterator over (sha, path) pairs.
def find_common_revisions(self, graphwalker):
Find which revisions this store has in common using graphwalker.
ParametersgraphwalkerA graphwalker object.
ReturnsList of SHAs that are in common
def generate_pack_contents(self, have, want, progress=None):
Iterate over the contents of a pack file.
ParametershaveList of SHA1s of objects that should not be sent
wantList of SHA1s of objects that should be sent
progressOptional progress reporting method
def generate_pack_data(self, have, want, progress=None, ofs_delta=True):
Generate pack data objects for a set of wants/haves.
ParametershaveList of SHA1s of objects that should not be sent
wantList of SHA1s of objects that should be sent
ofs_deltaWhether OFS deltas can be included
progressOptional progress reporting method
def peel_sha(self, sha):
Peel all tags from a SHA.
ParametersshaThe object SHA to peel.
ReturnsThe fully-peeled SHA1 of a tag object, after peeling all intermediate tags; if the original ref does not point to a tag, this will equal the original SHA1.
def _collect_ancestors(self, heads, common=set(), get_parents=lambda commit: commit.parents):
Collect all ancestors of heads up to (excluding) those in common.
Parametersheadscommits to start from
commoncommits to end at, or empty set to walk repository completely
get_parentsOptional function for getting the parents of a commit.
Returnsa tuple (A, B) where A - all commits reachable from heads but not present in common, B - common (shared) elements that are directly reachable from heads
def close(self):
Close any files opened by this object store.
API Documentation for Dulwich, generated by pydoctor at 2018-11-17 19:05:54.