/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/remote.py

  • Committer: Andrew Bennetts
  • Date: 2009-10-07 06:45:06 UTC
  • mto: This revision was merged to the branch mainline in revision 4734.
  • Revision ID: andrew.bennetts@canonical.com-20091007064506-skmf9v2o79p255eo
Add -Drelock debug flag.

Show diffs side-by-side

added added

removed removed

Lines of Context:
651
651
        self._lock_token = None
652
652
        self._lock_count = 0
653
653
        self._leave_lock = False
 
654
        self._prev_lock = None
654
655
        # Cache of revision parents; misses are cached during read locks, and
655
656
        # write locks when no _real_repository has been set.
656
657
        self._unstacked_provider = graph.CachingParentsProvider(
949
950
    def lock_read(self):
950
951
        # wrong eventually - want a local lock cache context
951
952
        if not self._lock_mode:
 
953
            if 'relock' in debug.debug_flags and self._prev_lock == 'r':
 
954
                note('%r was read locked again', self)
 
955
            self._prev_lock = 'r'
952
956
            self._lock_mode = 'r'
953
957
            self._lock_count = 1
954
958
            self._unstacked_provider.enable_cache(cache_misses=True)
974
978
 
975
979
    def lock_write(self, token=None, _skip_rpc=False):
976
980
        if not self._lock_mode:
 
981
            if 'relock' in debug.debug_flags and self._prev_lock == 'w':
 
982
                note('%r was write locked again', self)
 
983
            self._prev_lock = 'w'
977
984
            if _skip_rpc:
978
985
                if self._lock_token is not None:
979
986
                    if token != self._lock_token:
2131
2138
        self._repo_lock_token = None
2132
2139
        self._lock_count = 0
2133
2140
        self._leave_lock = False
 
2141
        self._prev_lock = None
2134
2142
        # Setup a format: note that we cannot call _ensure_real until all the
2135
2143
        # attributes above are set: This code cannot be moved higher up in this
2136
2144
        # function.
2318
2326
    def lock_read(self):
2319
2327
        self.repository.lock_read()
2320
2328
        if not self._lock_mode:
 
2329
            if 'relock' in debug.debug_flags and self._prev_lock == 'r':
 
2330
                note('%r was read locked again', self)
 
2331
            self._prev_lock = 'r'
2321
2332
            self._lock_mode = 'r'
2322
2333
            self._lock_count = 1
2323
2334
            if self._real_branch is not None:
2343
2354
 
2344
2355
    def lock_write(self, token=None):
2345
2356
        if not self._lock_mode:
 
2357
            if 'relock' in debug.debug_flags and self._prev_lock == 'w':
 
2358
                note('%r was write locked again', self)
 
2359
            self._prev_lock = 'w'
2346
2360
            # Lock the branch and repo in one remote call.
2347
2361
            remote_tokens = self._remote_lock_write(token)
2348
2362
            self._lock_token, self._repo_lock_token = remote_tokens