~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/check.py

  • Committer: Andrew Bennetts
  • Date: 2007-10-05 00:44:53 UTC
  • mto: This revision was merged to the branch mainline in revision 2905.
  • Revision ID: andrew.bennetts@canonical.com-20071005004453-01gpk6nnh4zelciv
Move check_parents out of VersionedFile.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
# raising them.  If there's more than one exception it'd be good to see them
33
33
# all.
34
34
 
 
35
from bzrlib import errors
35
36
from bzrlib import repository as _mod_repository
 
37
from bzrlib import revision
36
38
from bzrlib.errors import BzrCheckError
37
39
import bzrlib.ui
38
 
from bzrlib.trace import note
 
40
from bzrlib.trace import log_error, note, mutter
39
41
 
40
42
class Check(object):
41
43
    """Check a repository"""
97
99
             self.repository.bzrdir.root_transport,
98
100
             self.repository._format)
99
101
        note('%6d revisions', self.checked_rev_cnt)
100
 
        note('%6d versionedfiles', len(self.checked_weaves))
 
102
        note('%6d file-ids', len(self.checked_weaves))
101
103
        note('%6d unique file texts', self.checked_text_cnt)
102
104
        note('%6d repeated file texts', self.repeated_text_cnt)
103
105
        note('%6d unreferenced text ancestors',
123
125
                        note('       * %s', linker)
124
126
            if verbose:
125
127
                for file_id, revision_id in self.unreferenced_ancestors:
126
 
                    note('unreferenced ancestor: {%s} in %s', revision_id,
 
128
                    log_error('unreferenced ancestor: {%s} in %s', revision_id,
127
129
                        file_id)
128
130
        if len(self.inconsistent_parents):
129
131
            note('%6d inconsistent parents', len(self.inconsistent_parents))
190
192
                    self.repository.get_transaction())
191
193
            # No progress here, because it looks ugly.
192
194
            w.check()
193
 
            result = w.check_parents(
194
 
                self.planned_revisions,
195
 
                self.revision_versions.get_text_version,
196
 
                weave_id,
197
 
                revision_parents,
198
 
                self.repository.get_graph(),
199
 
                self.repository.get_inventory)
 
195
 
 
196
            weave_checker = self.repository.get_versioned_file_checker(
 
197
                self.planned_revisions, self.revision_versions)
 
198
            result = weave_checker.check_file_version_parents(
 
199
                w, weave_id, revision_parents)
 
200
 
200
201
            for revision_id, (weave_parents,correct_parents) in result.items():
201
202
                self.inconsistent_parents.append(
202
203
                    (revision_id, weave_id, weave_parents, correct_parents))
248
249
        branch.unlock()
249
250
    branch_result.report_results(verbose)
250
251
    repo_result.report_results(verbose)
 
252
 
 
253
 
 
254