103
105
self.repository.lock_read()
104
106
self.progress = ui.ui_factory.nested_progress_bar()
106
self.progress.update('check', 0, 4)
108
self.progress.update(gettext('check'), 0, 4)
107
109
if self.check_repo:
108
self.progress.update('checking revisions', 0)
110
self.progress.update(gettext('checking revisions'), 0)
109
111
self.check_revisions()
110
self.progress.update('checking commit contents', 1)
112
self.progress.update(gettext('checking commit contents'), 1)
111
113
self.repository._check_inventories(self)
112
self.progress.update('checking file graphs', 2)
114
self.progress.update(gettext('checking file graphs'), 2)
113
115
# check_weaves is done after the revision scan so that
114
116
# revision index is known to be valid.
115
117
self.check_weaves()
116
self.progress.update('checking branches and trees', 3)
118
self.progress.update(gettext('checking branches and trees'), 3)
117
119
if callback_refs:
118
120
repo = self.repository
119
121
# calculate all refs, and callback the objects requesting them.
200
202
result.report_results(verbose)
202
204
def _report_repo_results(self, verbose):
203
note('checked repository %s format %s',
205
note(gettext('checked repository {0} format {1}').format(
204
206
self.repository.user_url,
205
self.repository._format)
206
note('%6d revisions', self.checked_rev_cnt)
207
note('%6d file-ids', len(self.checked_weaves))
207
self.repository._format))
208
note(gettext('%6d revisions'), self.checked_rev_cnt)
209
note(gettext('%6d file-ids'), len(self.checked_weaves))
209
note('%6d unreferenced text versions',
211
note(gettext('%6d unreferenced text versions'),
210
212
len(self.unreferenced_versions))
211
213
if verbose and len(self.unreferenced_versions):
212
214
for file_id, revision_id in self.unreferenced_versions:
213
note('unreferenced version: {%s} in %s', revision_id,
215
note(gettext('unreferenced version: {{{0}}} in {1}').format(revision_id,
215
217
if self.missing_inventory_sha_cnt:
216
note('%6d revisions are missing inventory_sha1',
218
note(gettext('%6d revisions are missing inventory_sha1'),
217
219
self.missing_inventory_sha_cnt)
218
220
if self.missing_revision_cnt:
219
note('%6d revisions are mentioned but not present',
221
note(gettext('%6d revisions are mentioned but not present'),
220
222
self.missing_revision_cnt)
221
223
if len(self.ghosts):
222
note('%6d ghost revisions', len(self.ghosts))
224
note(gettext('%6d ghost revisions'), len(self.ghosts))
224
226
for ghost in self.ghosts:
225
227
note(' %s', ghost)
226
228
if len(self.missing_parent_links):
227
note('%6d revisions missing parents in ancestry',
229
note(gettext('%6d revisions missing parents in ancestry'),
228
230
len(self.missing_parent_links))
230
232
for link, linkers in self.missing_parent_links.items():
231
note(' %s should be in the ancestry for:', link)
233
note(gettext(' %s should be in the ancestry for:'), link)
232
234
for linker in linkers:
233
235
note(' * %s', linker)
234
236
if len(self.inconsistent_parents):
235
note('%6d inconsistent parents', len(self.inconsistent_parents))
237
note(gettext('%6d inconsistent parents'), len(self.inconsistent_parents))
237
239
for info in self.inconsistent_parents:
238
240
revision_id, file_id, found_parents, correct_parents = info
239
note(' * %s version %s has parents %r '
241
% (file_id, revision_id, found_parents,
241
note(gettext(' * {0} version {1} has parents {2!r} '
242
'but should have {3!r}').format(
243
file_id, revision_id, found_parents,
242
244
correct_parents))
243
245
if self.revs_with_bad_parents_in_index:
244
note('%6d revisions have incorrect parents in the revision index',
247
'%6d revisions have incorrect parents in the revision index'),
245
248
len(self.revs_with_bad_parents_in_index))
247
250
for item in self.revs_with_bad_parents_in_index:
248
251
revision_id, index_parents, actual_parents = item
250
' %s has wrong parents in index: '
252
revision_id, index_parents, actual_parents)
253
' {0} has wrong parents in index: '
254
'{1!r} should be {2!r}').format(
255
revision_id, index_parents, actual_parents))
253
256
for item in self._report_items:
422
425
scan_branch(branch, needed_refs, to_unlock)
423
426
if do_branch and not branches:
424
note("No branch found at specified location.")
427
note(gettext("No branch found at specified location."))
425
428
if do_tree and base_tree is None and not saw_tree:
426
note("No working tree found at specified location.")
429
note(gettext("No working tree found at specified location."))
427
430
if do_repo or do_branch or do_tree:
429
note("Checking repository at '%s'."
432
note(gettext("Checking repository at '%s'.")
430
433
% (repo.user_url,))
431
434
result = repo.check(None, callback_refs=needed_refs,
432
435
check_repo=do_repo)
433
436
result.report_results(verbose)
436
note("No working tree found at specified location.")
439
note(gettext("No working tree found at specified location."))
438
note("No branch found at specified location.")
441
note(gettext("No branch found at specified location."))
440
note("No repository found at specified location.")
443
note(gettext("No repository found at specified location."))
442
445
for thing in to_unlock: