~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/check.py

Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
330
330
            self.text_key_references[key] = True
331
331
 
332
332
 
333
 
@deprecated_function(deprecated_in((1,6,0)))
334
 
def check(branch, verbose):
335
 
    """Run consistency checks on a branch.
336
 
 
337
 
    Results are reported through logging.
338
 
 
339
 
    Deprecated in 1.6.  Please use check_dwim instead.
340
 
 
341
 
    :raise BzrCheckError: if there's a consistency error.
342
 
    """
343
 
    check_branch(branch, verbose)
344
 
 
345
 
 
346
 
@deprecated_function(deprecated_in((1,16,0)))
347
 
def check_branch(branch, verbose):
348
 
    """Run consistency checks on a branch.
349
 
 
350
 
    Results are reported through logging.
351
 
 
352
 
    :raise BzrCheckError: if there's a consistency error.
353
 
    """
354
 
    branch.lock_read()
355
 
    try:
356
 
        needed_refs = {}
357
 
        for ref in branch._get_check_refs():
358
 
            needed_refs.setdefault(ref, []).append(branch)
359
 
        result = branch.repository.check([branch.last_revision()], needed_refs)
360
 
        branch_result = result.other_results[0]
361
 
    finally:
362
 
        branch.unlock()
363
 
    branch_result.report_results(verbose)
364
 
 
365
 
 
366
333
def scan_branch(branch, needed_refs, to_unlock):
367
334
    """Scan a branch for refs.
368
335