~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

  • Committer: Robert Collins
  • Date: 2009-05-11 03:48:49 UTC
  • mto: This revision was merged to the branch mainline in revision 4593.
  • Revision ID: robertc@robertcollins.net-20090511034849-vxl36avre2zd4bod
Move tree and back callbacks into the repository check core.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2454
2454
        return record.get_bytes_as('fulltext')
2455
2455
 
2456
2456
    @needs_read_lock
2457
 
    def check(self, revision_ids=None):
 
2457
    def check(self, revision_ids=None, callback_refs=None, check_repo=True):
2458
2458
        """Check consistency of all history of given revision_ids.
2459
2459
 
2460
2460
        Different repository implementations should override _check().
2461
2461
 
2462
2462
        :param revision_ids: A non-empty list of revision_ids whose ancestry
2463
2463
             will be checked.  Typically the last revision_id of a branch.
 
2464
        :param callback_refs: A dict of check-refs to resolve and callback
 
2465
            the check/_check method on the items listed as wanting the ref.
 
2466
            see bzrlib.check.
 
2467
        :param check_repo: If False do not check the repository contents, just 
 
2468
            calculate the data callback_refs requires and call them back.
2464
2469
        """
2465
2470
        # TODO: Reinstate or confirm its obsolescence.
2466
2471
        # from Branch.check - a cross check that the parents index
2487
2492
        #                                "parents of {%s}"
2488
2493
        #                                % (mainline_parent_id, revision_id))
2489
2494
        #            mainline_parent_id = revision_id
2490
 
        return self._check(revision_ids)
 
2495
        return self._check(revision_ids, callback_refs=callback_refs,
 
2496
            check_repo=check_repo)
2491
2497
 
2492
 
    def _check(self, revision_ids):
2493
 
        result = check.Check(self)
2494
 
        result.check()
 
2498
    def _check(self, revision_ids, callback_refs, check_repo):
 
2499
        result = check.Check(self, check_repo=check_repo)
 
2500
        result.check(callback_refs)
2495
2501
        return result
2496
2502
 
2497
2503
    def _warn_if_deprecated(self):