~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/check.py

  • Committer: Martin Pool
  • Date: 2005-07-11 07:05:34 UTC
  • Revision ID: mbp@sourcefrog.net-20050711070534-5227696ab167ccde
- merge aaron's append_multiple.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
def check(branch):
22
22
    """Run consistency checks on a branch.
23
23
 
24
 
    TODO: Also check non-mailine revisions mentioned as parents.
 
24
    TODO: Also check non-mainline revisions mentioned as parents.
 
25
 
 
26
    TODO: Check for extra files in the control directory.
25
27
    """
26
28
    from bzrlib.trace import mutter
27
29
    from bzrlib.errors import BzrCheckError
40
42
        history = branch.revision_history()
41
43
        revno = 0
42
44
        revcount = len(history)
 
45
        mismatch_inv_id = []
43
46
 
44
47
        # for all texts checked, text_id -> sha1
45
48
        checked_texts = {}
83
86
                                    "by {%s}"
84
87
                                    % (rev_id, last_rev_id))
85
88
 
 
89
            if rev.inventory_id != rev_id:
 
90
                mismatch_inv_id.append(rev_id)
 
91
 
86
92
            ## TODO: Check all the required fields are present on the revision.
87
93
 
88
94
            if rev.inventory_sha1:
164
170
    if (missing_inventory_sha_cnt
165
171
        or missing_revision_sha_cnt):
166
172
        print '  (use "bzr upgrade" to fix them)'
 
173
 
 
174
    if mismatch_inv_id:
 
175
        print '%d revisions have mismatched inventory ids:' % len(mismatch_inv_id)
 
176
        for rev_id in mismatch_inv_id:
 
177
            print '  ', rev_id