~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/groupcompress.py

  • Committer: Andrew Bennetts
  • Date: 2009-09-08 06:25:26 UTC
  • mto: (4634.6.27 2.0)
  • mto: This revision was merged to the branch mainline in revision 4680.
  • Revision ID: andrew.bennetts@canonical.com-20090908062526-e8j6ch99ixihi3qd
Move tests to per_repository_chk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1168
1168
class GroupCompressVersionedFiles(VersionedFiles):
1169
1169
    """A group-compress based VersionedFiles implementation."""
1170
1170
 
1171
 
    def __init__(self, index, access, delta=True):
 
1171
    def __init__(self, index, access, delta=True, _unadded_refs=None):
1172
1172
        """Create a GroupCompressVersionedFiles object.
1173
1173
 
1174
1174
        :param index: The index object storing access and graph data.
1175
1175
        :param access: The access object storing raw data.
1176
1176
        :param delta: Whether to delta compress or just entropy compress.
 
1177
        :param _unadded_refs: private parameter, don't use.
1177
1178
        """
1178
1179
        self._index = index
1179
1180
        self._access = access
1180
1181
        self._delta = delta
1181
 
        self._unadded_refs = {}
 
1182
        if _unadded_refs is None:
 
1183
            _unadded_refs = {}
 
1184
        self._unadded_refs = _unadded_refs
1182
1185
        self._group_cache = LRUSizeCache(max_size=50*1024*1024)
1183
1186
        self._fallback_vfs = []
1184
1187
 
1185
1188
    def without_fallbacks(self):
1186
 
        gcvf = GroupCompressVersionedFiles(
1187
 
            self._index, self._access, self._delta)
1188
 
        gcvf._unadded_refs = dict(self._unadded_refs)
1189
 
        return gcvf
 
1189
        """Return a clone of this object without any fallbacks configured."""
 
1190
        return GroupCompressVersionedFiles(self._index, self._access,
 
1191
            self._delta, _unadded_refs=dict(self._unadded_refs))
1190
1192
 
1191
1193
    def add_lines(self, key, parents, lines, parent_texts=None,
1192
1194
        left_matching_blocks=None, nostore_sha=None, random_id=False,