/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-11-28 01:35:49 UTC
  • mfrom: (3036.1.4 check)
  • Revision ID: pqm@pqm.ubuntu.com-20071128013549-w54seazrf4oeywb9
(robertc) Fix check to correctly report unreferenced texts. (Robert
        Collins, John A Meinel, 162931, 165071)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1670
1670
                [parents_provider, other_repository._make_parents_provider()])
1671
1671
        return graph.Graph(parents_provider)
1672
1672
 
1673
 
    def get_versioned_file_checker(self):
 
1673
    def _get_versioned_file_checker(self):
1674
1674
        """Return an object suitable for checking versioned files."""
1675
 
        return VersionedFileChecker(self)
 
1675
        return _VersionedFileChecker(self)
1676
1676
 
1677
1677
    @needs_write_lock
1678
1678
    def set_make_working_trees(self, new_value):
2892
2892
    return _unescape_re.sub(_unescaper, data)
2893
2893
 
2894
2894
 
2895
 
class VersionedFileChecker(object):
 
2895
class _VersionedFileChecker(object):
2896
2896
 
2897
2897
    def __init__(self, repository):
2898
2898
        self.repository = repository
2908
2908
        # strip the file_id, for the weave api
2909
2909
        return tuple([revision_id for file_id, revision_id in parent_keys])
2910
2910
 
2911
 
    def check_file_version_parents(self, weave, file_id, planned_revisions):
 
2911
    def check_file_version_parents(self, weave, file_id):
2912
2912
        """Check the parents stored in a versioned file are correct.
2913
2913
 
2914
2914
        It also detects file versions that are not referenced by their
2923
2923
        """
2924
2924
        wrong_parents = {}
2925
2925
        unused_versions = set()
2926
 
        for num, revision_id in enumerate(planned_revisions):
 
2926
        for num, revision_id in enumerate(weave.versions()):
2927
2927
            try:
2928
2928
                correct_parents = self.calculate_file_version_parents(
2929
2929
                    revision_id, file_id)
2930
2930
            except KeyError:
2931
 
                # we were asked to investigate a non-existant version.
 
2931
                # The version is not part of the used keys.
2932
2932
                unused_versions.add(revision_id)
2933
2933
            else:
2934
2934
                try: