~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/pack_repo.py

Merge bzr.dev 4734 in preparation for NEWS updates.

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
    revision as _mod_revision,
55
55
    )
56
56
 
57
 
from bzrlib.decorators import needs_write_lock
 
57
from bzrlib.decorators import needs_write_lock, only_raises
58
58
from bzrlib.btree_index import (
59
59
    BTreeGraphIndex,
60
60
    BTreeBuilder,
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()
2345
2352
        packer = ReconcilePacker(collection, packs, extension, revs)
2346
2353
        return packer.pack(pb)
2347
2354
 
 
2355
    @only_raises(errors.LockNotHeld, errors.LockBroken)
2348
2356
    def unlock(self):
2349
2357
        if self._write_lock_count == 1 and self._write_group is not None:
2350
2358
            self.abort_write_group()