def __init__(self, a_transport, prefixed=False, compressed=False, dir_mode=None, file_mode=None, escaped=False): super(TransportStore, self).__init__() self._transport = a_transport self._prefixed = prefixed # FIXME RBC 20051128 this belongs in TextStore. self._compressed = compressed self._suffixes = set() self._escaped = escaped # It is okay for these to be None, it just means they # will just use the filesystem defaults self._dir_mode = dir_mode self._file_mode = file_mode # Create a key mapper to use if escaped and prefixed: self._mapper = versionedfile.HashEscapedPrefixMapper() elif not escaped and prefixed: self._mapper = versionedfile.HashPrefixMapper() elif self._escaped: raise ValueError( "%r: escaped unprefixed stores are not permitted." % (self, )) else: self._mapper = versionedfile.PrefixMapper()
def _get_texts(self, repo_transport, repo): mapper = versionedfile.HashPrefixMapper() base_transport = repo_transport.clone('weaves') return versionedfile.ThunkedVersionedFiles(base_transport, weave.WeaveFile, mapper, repo.is_locked)
def _get_revisions(self, repo_transport, repo): from bzrlib.xml5 import serializer_v5 return RevisionTextStore(repo_transport.clone('revision-store'), serializer_v5, True, versionedfile.HashPrefixMapper(), repo.is_locked, repo.is_write_locked)
def _get_signatures(self, repo_transport, repo): return SignatureTextStore(repo_transport.clone('revision-store'), True, versionedfile.HashPrefixMapper(), repo.is_locked, repo.is_write_locked)
def _get_revisions(self, repo_transport, repo): return RevisionTextStore(repo_transport.clone('revision-store'), xml5.serializer_v5, False, versionedfile.HashPrefixMapper(), repo.is_locked, repo.is_write_locked)