18
18
# TODO: Check ancestries are correct for every revision: includes
19
19
# every committed so far, and in a reasonable order.
21
# TODO: Also check non-mainline revisions mentioned as parents.
23
# TODO: Check for extra files in the control directory.
22
27
from bzrlib.trace import note, warning
23
28
from bzrlib.osutils import rename, sha_string, fingerprint_file
27
32
from bzrlib.branch import gen_root_id
31
"""Run consistency checks on a branch.
33
TODO: Also check non-mainline revisions mentioned as parents.
35
TODO: Check for extra files in the control directory.
37
def __init__(self, branch):
42
47
missing_inventory_sha_cnt = 0
136
141
seen_names[path] = True
137
142
last_rev_id = rev_id
144
note('checked %d revisions, %d file texts' % (revcount, checked_text_count))
146
if missing_inventory_sha_cnt:
147
note('%d revisions are missing inventory_sha1' % missing_inventory_sha_cnt)
149
##if missing_revision_sha_cnt:
150
## note('%d parent links are missing revision_sha1' % missing_revision_sha_cnt)
152
if missing_revision_cnt:
153
note('%d revisions are mentioned but not present' % missing_revision_cnt)
155
if missing_revision_cnt:
156
print '%d revisions are mentioned but not present' % missing_revision_cnt
158
# stub this out for now because the main bzr branch has references
159
# to revisions that aren't present in the store -- mbp 20050804
160
# if (missing_inventory_sha_cnt
161
# or missing_revision_sha_cnt):
162
# print ' (use "bzr upgrade" to fix them)'
147
note('checked %d revisions, %d file texts' % (revcount, checked_text_count))
149
if missing_inventory_sha_cnt:
150
note('%d revisions are missing inventory_sha1' % missing_inventory_sha_cnt)
152
##if missing_revision_sha_cnt:
153
## note('%d parent links are missing revision_sha1' % missing_revision_sha_cnt)
155
if missing_revision_cnt:
156
note('%d revisions are mentioned but not present' % missing_revision_cnt)
158
if missing_revision_cnt:
159
print '%d revisions are mentioned but not present' % missing_revision_cnt
161
# stub this out for now because the main bzr branch has references
162
# to revisions that aren't present in the store -- mbp 20050804
163
# if (missing_inventory_sha_cnt
164
# or missing_revision_sha_cnt):
165
# print ' (use "bzr upgrade" to fix them)'
174
"""Run consistency checks on a branch."""