class documentation

class SwiftObjectStore(PackBasedObjectStore):

View In Hierarchy

A Swift Object Store

Allow to manage a bare Git repository from Openstack Swift. This object store only supports pack files and not loose objects.

Method __init__ Open a Swift object store.
Method add_object Add a single object to this object store.
Method add_pack Add a new pack to this object store.
Method add_thin_pack Read a thin pack
Method find_missing_objects Find the missing objects required for a set of revisions.
Method iter_shas An iterator over pack's ObjectStore.
Method pack_info_get Undocumented
Instance Variable pack_dir Undocumented
Instance Variable root Undocumented
Instance Variable scon Undocumented
Method _collect_ancestors Collect all ancestors of heads up to (excluding) those in common.
Method _complete_thin_pack Undocumented
Method _get_loose_object Undocumented
Method _iter_loose_objects Loose objects are not supported by this repository
Method _pack_cache_stale Undocumented
Method _update_pack_cache Undocumented
Instance Variable _alternates Undocumented

Inherited from PackBasedObjectStore:

Method __contains__ Check if a particular object is present by SHA1.
Method __iter__ Iterate over the SHAs that are present in this store.
Method add_objects Add a set of objects to this object store.
Method close Close any files opened by this object store.
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 get_raw Obtain the raw fulltext for an object.
Method pack_loose_objects Pack loose objects.
Method repack Repack the packs in this repository.
Instance Variable pack_compression_level Undocumented
Property alternates Undocumented
Property packs List with pack objects.
Method _add_cached_pack Add a newly appeared pack to the cache by path.
Method _clear_cached_packs Undocumented
Method _iter_alternate_objects Iterate over the SHAs of all the objects in alternate stores.
Method _iter_cached_packs Undocumented
Method _remove_loose_object Undocumented
Method _remove_pack Undocumented
Instance Variable _pack_cache Undocumented

Inherited from BaseObjectStore (via PackBasedObjectStore):

Method __getitem__ Obtain an object by SHA1.
Method add_pack_data Add pack data to this object store.
Method determine_wants_all Undocumented
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 iter_tree_contents Iterate the contents of a tree and all subtrees.
Method peel_sha Peel all tags from a SHA.
Method tree_changes Find the differences between the contents of two trees
Method _get_depth Return the current available depth for the given head. For commits with multiple parents, the largest possible depth will be returned.
def __init__(self, scon):

Open a Swift object store.

Parameters
sconA SwiftConnector instance
def add_object(self, obj):

Add a single object to this object store.

def add_pack(self):

Add a new pack to this object store.

Returns: Fileobject to write to and a commit function to
call when the pack is finished.
def add_thin_pack(self, read_all, read_some):

Read a thin pack

Read it from a stream and complete it in a temporary file. Then the pack and the corresponding index file are uploaded to Swift.

def find_missing_objects(self, *args, **kwargs):

Find the missing objects required for a set of revisions.

Returns: Iterator over (sha, path) pairs.

Parameters
*argsUndocumented
**kwargsUndocumented
havesIterable over SHAs already in common.
wantsIterable over SHAs of objects to fetch.
shallowSet of shallow commit SHA1s to skip
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.
def iter_shas(self, finder):

An iterator over pack's ObjectStore.

Returns: a ObjectStoreIterator or GreenThreadsObjectStoreIterator
instance if gevent is enabled
def pack_info_get(self, sha):

Undocumented

pack_dir =

Undocumented

root =

Undocumented

scon =

Undocumented

def _collect_ancestors(self, heads, common=set()):

Collect all ancestors of heads up to (excluding) those in common.

Returns: a 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
Parameters
headscommits to start from
commoncommits to end at, or empty set to walk repository completely
get_parentsOptional function for getting the parents of a commit.
def _complete_thin_pack(self, f, path, copier, indexer):

Undocumented

def _get_loose_object(self, sha):
def _iter_loose_objects(self):

Loose objects are not supported by this repository

def _pack_cache_stale(self):

Undocumented

def _update_pack_cache(self):
_alternates =

Undocumented