~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/groupcompress.py

(spiv) Move duplicate definitions of {Knit,
 GroupCompress}VersionedFiles.get_known_graph_ancestry into
 VersionedFilesWithFallbacks. (Andrew Bennetts)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1317
1317
            self._check_lines_not_unicode(lines)
1318
1318
            self._check_lines_are_lines(lines)
1319
1319
 
1320
 
    def get_known_graph_ancestry(self, keys):
1321
 
        """Get a KnownGraph instance with the ancestry of keys."""
1322
 
        # Note that this is identical to
1323
 
        # KnitVersionedFiles.get_known_graph_ancestry, but they don't share
1324
 
        # ancestry.
1325
 
        parent_map, missing_keys = self._index.find_ancestry(keys)
1326
 
        for fallback in self._transitive_fallbacks():
1327
 
            if not missing_keys:
1328
 
                break
1329
 
            (f_parent_map, f_missing_keys) = fallback._index.find_ancestry(
1330
 
                                                missing_keys)
1331
 
            parent_map.update(f_parent_map)
1332
 
            missing_keys = f_missing_keys
1333
 
        kg = _mod_graph.KnownGraph(parent_map)
1334
 
        return kg
1335
 
 
1336
1320
    def get_parent_map(self, keys):
1337
1321
        """Get a map of the graph parents of keys.
1338
1322