~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/versionedfile.py

  • Committer: INADA Naoki
  • Date: 2011-05-05 09:15:34 UTC
  • mto: (5830.3.3 i18n-msgfmt)
  • mto: This revision was merged to the branch mainline in revision 5873.
  • Revision ID: songofacandy@gmail.com-20110505091534-7sv835xpofwrmpt4
Add update-pot command to Makefile and tools/bzrgettext script that
extracts help text from bzr commands.

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 VersionedFileCommitBuilder.
 
975
        This is a private function for use by CommitBuilder.
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
 
 
1452
1425
class _PlanMergeVersionedFile(VersionedFiles):
1453
1426
    """A VersionedFile for uncommitted and committed texts.
1454
1427