/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/lockable_files.py

  • Committer: Robert Collins
  • Date: 2009-03-16 05:05:52 UTC
  • mto: This revision was merged to the branch mainline in revision 4149.
  • Revision ID: robertc@robertcollins.net-20090316050552-hqcgx49ugew0facc
Add a refresh_data method on Repository allowing cleaner handling of insertions into RemoteRepository objects with _real_repository instances.

Show diffs side-by-side

added added

removed removed

Lines of Context:
271
271
            #traceback.print_stack()
272
272
            self._lock_mode = 'w'
273
273
            self._lock_warner.lock_count = 1
274
 
            self._set_transaction(transactions.WriteTransaction())
 
274
            self._set_write_transaction()
275
275
            self._token_from_lock = token_from_lock
276
276
            return token_from_lock
277
277
 
285
285
            #traceback.print_stack()
286
286
            self._lock_mode = 'r'
287
287
            self._lock_warner.lock_count = 1
288
 
            self._set_transaction(transactions.ReadOnlyTransaction())
289
 
            # 5K may be excessive, but hey, its a knob.
290
 
            self.get_transaction().set_cache_size(5000)
 
288
            self._set_read_transaction()
 
289
 
 
290
    def _set_read_transaction(self):
 
291
        """Setup a read transaction."""
 
292
        self._set_transaction(transactions.ReadOnlyTransaction())
 
293
        # 5K may be excessive, but hey, its a knob.
 
294
        self.get_transaction().set_cache_size(5000)
 
295
 
 
296
    def _set_write_transaction(self):
 
297
        """Setup a write transaction."""
 
298
        self._set_transaction(transactions.WriteTransaction())
291
299
 
292
300
    def unlock(self):
293
301
        if not self._lock_mode: