~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

  • Committer: Ian Clatworthy
  • Date: 2009-03-16 13:16:44 UTC
  • mto: (4150.1.1 ianc-integration)
  • mto: This revision was merged to the branch mainline in revision 4151.
  • Revision ID: ian.clatworthy@canonical.com-20090316131644-r7kevoidcxw30i8d
faster check

Show diffs side-by-side

added added

removed removed

Lines of Context:
1356
1356
    def find_text_key_references(self):
1357
1357
        """Find the text key references within the repository.
1358
1358
 
1359
 
        :return: a dictionary mapping (file_id, revision_id) tuples to altered file-ids to an iterable of
1360
 
        revision_ids. Each altered file-ids has the exact revision_ids that
1361
 
        altered it listed explicitly.
1362
1359
        :return: A dictionary mapping text keys ((fileid, revision_id) tuples)
1363
1360
            to whether they were referred to by the inventory of the
1364
1361
            revision_id that they contain. The inventory texts from all present
1968
1965
                [parents_provider, other_repository._make_parents_provider()])
1969
1966
        return graph.Graph(parents_provider)
1970
1967
 
1971
 
    def _get_versioned_file_checker(self):
1972
 
        """Return an object suitable for checking versioned files."""
1973
 
        return _VersionedFileChecker(self)
 
1968
    def _get_versioned_file_checker(self, text_key_references=None):
 
1969
        """Return an object suitable for checking versioned files.
 
1970
        
 
1971
        :param text_key_references: if non-None, an already built
 
1972
            dictionary mapping text keys ((fileid, revision_id) tuples)
 
1973
            to whether they were referred to by the inventory of the
 
1974
            revision_id that they contain. If None, this will be
 
1975
            calculated.
 
1976
        """
 
1977
        return _VersionedFileChecker(self,
 
1978
            text_key_references=text_key_references)
1974
1979
 
1975
1980
    def revision_ids_to_search_result(self, result_set):
1976
1981
        """Convert a set of revision ids to a graph SearchResult."""
3478
3483
 
3479
3484
class _VersionedFileChecker(object):
3480
3485
 
3481
 
    def __init__(self, repository):
 
3486
    def __init__(self, repository, text_key_references=None):
3482
3487
        self.repository = repository
3483
 
        self.text_index = self.repository._generate_text_key_index()
 
3488
        self.text_index = self.repository._generate_text_key_index(
 
3489
            text_key_references=text_key_references)
3484
3490
 
3485
3491
    def calculate_file_version_parents(self, text_key):
3486
3492
        """Calculate the correct parents for a file version according to