~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/pack_repo.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-10-08 23:44:40 UTC
  • mfrom: (4731.1.5 debug-flag-relock)
  • Revision ID: pqm@pqm.ubuntu.com-20091008234440-e0thgiawplpcqomd
(andrew) Add -Drelock debug flag that makes noise about wasteful
        unlocking and relocking.

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
    )
74
74
from bzrlib.trace import (
75
75
    mutter,
 
76
    note,
76
77
    warning,
77
78
    )
78
79
 
2300
2301
        if self._write_lock_count == 1:
2301
2302
            self._transaction = transactions.WriteTransaction()
2302
2303
        if not locked:
 
2304
            if 'relock' in debug.debug_flags and self._prev_lock == 'w':
 
2305
                note('%r was write locked again', self)
 
2306
            self._prev_lock = 'w'
2303
2307
            for repo in self._fallback_repositories:
2304
2308
                # Writes don't affect fallback repos
2305
2309
                repo.lock_read()
2312
2316
        else:
2313
2317
            self.control_files.lock_read()
2314
2318
        if not locked:
 
2319
            if 'relock' in debug.debug_flags and self._prev_lock == 'r':
 
2320
                note('%r was read locked again', self)
 
2321
            self._prev_lock = 'r'
2315
2322
            for repo in self._fallback_repositories:
2316
2323
                repo.lock_read()
2317
2324
            self._refresh_data()