~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/knit.py

Merge missing-parents-in-pack-index work-in-progress.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2200
2200
                "parent tracking.")
2201
2201
        self.has_graph = parents
2202
2202
        self._is_locked = is_locked
 
2203
        self._missing_compression_parents = set()
2203
2204
 
2204
2205
    def __repr__(self):
2205
2206
        return "%s(%r)" % (self.__class__.__name__, self._graph_index)
2267
2268
                result.append((key, value))
2268
2269
        self._add_callback(result)
2269
2270
        
 
2271
    def _add_unvalidated_index(self, graph_index):
 
2272
        """Inform this _KnitGraphIndex that there is an unvalidated index.
 
2273
 
 
2274
        This allows this _KnitGraphIndex to keep track of any missing
 
2275
        compression parents we may want to have filled in to make those
 
2276
        indices valid.
 
2277
 
 
2278
        :param graph_index: A GraphIndex
 
2279
        """
 
2280
        self._missing_compression_parents.update(
 
2281
            graph_index._external_references())
 
2282
        self._missing_compression_parents.difference_update(
 
2283
            self.get_parent_map(self._missing_compression_parents))
 
2284
 
 
2285
    def get_missing_compression_parents(self):
 
2286
        """Return the keys of compression parents missing from unvalidated
 
2287
        indices.
 
2288
        """
 
2289
        return frozenset(self._missing_compression_parents)
 
2290
 
2270
2291
    def _check_read(self):
2271
2292
        """raise if reads are not permitted."""
2272
2293
        if not self._is_locked():