~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/versionedfile.py

  • Committer: INADA Naoki
  • Date: 2011-05-17 00:45:09 UTC
  • mfrom: (5875 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5891.
  • Revision ID: songofacandy@gmail.com-20110517004509-q58negjbdjh7t6u1
mergeĀ fromĀ lp:bzr

Show diffs side-by-side

added added

removed removed

Lines of Context:
972
972
    def _add_text(self, key, parents, text, nostore_sha=None, random_id=False):
973
973
        """Add a text to the store.
974
974
 
975
 
        This is a private function for use by CommitBuilder.
 
975
        This is a private function for use by VersionedFileCommitBuilder.
976
976
 
977
977
        :param key: The key tuple of the text to add. If the last element is
978
978
            None, a CHK string will be generated during the addition.
1422
1422
        return result
1423
1423
 
1424
1424
 
 
1425
class VersionedFilesWithFallbacks(VersionedFiles):
 
1426
 
 
1427
    def without_fallbacks(self):
 
1428
        """Return a clone of this object without any fallbacks configured."""
 
1429
        raise NotImplementedError(self.without_fallbacks)
 
1430
 
 
1431
    def add_fallback_versioned_files(self, a_versioned_files):
 
1432
        """Add a source of texts for texts not present in this knit.
 
1433
 
 
1434
        :param a_versioned_files: A VersionedFiles object.
 
1435
        """
 
1436
        raise NotImplementedError(self.add_fallback_versioned_files)
 
1437
 
 
1438
    def get_known_graph_ancestry(self, keys):
 
1439
        """Get a KnownGraph instance with the ancestry of keys."""
 
1440
        parent_map, missing_keys = self._index.find_ancestry(keys)
 
1441
        for fallback in self._transitive_fallbacks():
 
1442
            if not missing_keys:
 
1443
                break
 
1444
            (f_parent_map, f_missing_keys) = fallback._index.find_ancestry(
 
1445
                                                missing_keys)
 
1446
            parent_map.update(f_parent_map)
 
1447
            missing_keys = f_missing_keys
 
1448
        kg = _mod_graph.KnownGraph(parent_map)
 
1449
        return kg
 
1450
 
 
1451
 
1425
1452
class _PlanMergeVersionedFile(VersionedFiles):
1426
1453
    """A VersionedFile for uncommitted and committed texts.
1427
1454