46
46
indicating that the revision was found/not found.
49
from bzrlib import errors
50
53
from bzrlib.branch import Branch
51
54
from bzrlib.bzrdir import BzrDir
52
55
from bzrlib.revision import NULL_REVISION
53
56
from bzrlib.symbol_versioning import deprecated_function, deprecated_in
54
57
from bzrlib.trace import note
56
58
from bzrlib.workingtree import WorkingTree
58
60
class Check(object):
88
90
if callback_refs is None:
90
92
self.repository.lock_read()
91
self.progress = bzrlib.ui.ui_factory.nested_progress_bar()
93
self.progress = ui.ui_factory.nested_progress_bar()
93
95
self.progress.update('check', 0, 4)
94
96
if self.check_repo:
328
330
self.text_key_references[key] = True
331
@deprecated_function(deprecated_in((1,6,0)))
332
def check(branch, verbose):
333
"""Run consistency checks on a branch.
335
Results are reported through logging.
337
Deprecated in 1.6. Please use check_dwim instead.
339
:raise BzrCheckError: if there's a consistency error.
341
check_branch(branch, verbose)
344
@deprecated_function(deprecated_in((1,16,0)))
345
def check_branch(branch, verbose):
346
"""Run consistency checks on a branch.
348
Results are reported through logging.
350
:raise BzrCheckError: if there's a consistency error.
355
for ref in branch._get_check_refs():
356
needed_refs.setdefault(ref, []).append(branch)
357
result = branch.repository.check([branch.last_revision()], needed_refs)
358
branch_result = result.other_results[0]
361
branch_result.report_results(verbose)
364
333
def scan_branch(branch, needed_refs, to_unlock):
365
334
"""Scan a branch for refs.