b.s.Store(object) : class documentation

Part of bzrlib.store View In Hierarchy

Known subclasses: bzrlib.store.TransportStore

This class represents the abstract storage layout for saving information.

Files can be added, but not modified once they are in. Typically the hash is used as the name, or something else known to be unique, such as a UUID.

Method __len__ Undocumented
Method get Returns a file reading from a particular entry.
Method __getitem__ DEPRECATED. Please use .get(fileid) instead.
Method __iter__ Undocumented
Method add Add a file object f to the store accessible from the given fileid
Method has_id Return True or false for the presence of fileid in the store.
Method listable Return True if this store is able to be listed.
Method copy_all_ids Copy all the file ids from store_from into self.
Method copy_multi Copy texts for ids from other into self.
Method _copy_one Most generic copy-one object routine.
def __len__(self):
Undocumented
def get(self, fileid, suffix=None):
Returns a file reading from a particular entry.

If suffix is present, retrieve the named suffix for fileid.

def __getitem__(self, fileid):
DEPRECATED. Please use .get(fileid) instead.
def __iter__(self):
Undocumented
def add(self, f, fileid):
Add a file object f to the store accessible from the given fileid
def has_id(self, fileid, suffix=None):
Return True or false for the presence of fileid in the store.

suffix, if present, is a per file suffix, i.e. for digital signature data.

def listable(self):
Return True if this store is able to be listed.
def copy_all_ids(self, store_from, pb=None):
Copy all the file ids from store_from into self.
def copy_multi(self, other, ids, pb=None, permit_failure=False):
Copy texts for ids from other into self.

If an id is present in self, it is skipped. A count of copied ids is returned, which may be less than len(ids).

ParametersotherAnother Store object
idsA list of entry ids to be copied
pbA ProgressTask object, if none is given, the default will be created.
permit_failureAllow missing entries to be ignored
Returns(n_copied, [failed]) The number of entries copied successfully, followed by a list of entries which could not be copied (because they were missing)
def _copy_one(self, fileid, suffix, other, pb):
Most generic copy-one object routine.

Subclasses can override this to provide an optimised copy between their own instances. Such overriden routines should call this if they have no optimised facility for a specific 'other'.

API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.