~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/check.py

  • Committer: Martin Pool
  • Date: 2005-09-22 07:14:40 UTC
  • Revision ID: mbp@sourcefrog.net-20050922071440-df7639b32dca95ab
- use cache for weaves for check only
- lock branch for read during check

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
    """Check a branch"""
40
40
    def __init__(self, branch):
41
41
        self.branch = branch
42
 
        self.run()
 
42
        branch.lock_read()
 
43
        try:
 
44
            self.run()
 
45
        finally:
 
46
            branch.unlock()
43
47
 
44
48
 
45
49
    def run(self):
46
50
        branch = self.branch
47
51
 
 
52
        branch.weave_store.enable_cache = True
 
53
        branch.control_weaves.enable_cache = True
 
54
 
48
55
        self.checked_text_cnt = 0
49
56
        self.checked_rev_cnt = 0
50
57
        self.repeated_text_cnt = 0