/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: Canonical.com Patch Queue Manager
  • Date: 2009-03-16 08:26:29 UTC
  • mfrom: (4145.1.6 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20090316082629-xuzqut3b3ur5bn3b
(robertc) Add a new repository method refresh_data to allow clean
        handling of _real_repositories after inserting a stream via the
        smart server. (Robert Collins, Andrew Bennetts)

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: