/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: Martin Pool
  • Date: 2006-03-03 06:43:48 UTC
  • mto: This revision was merged to the branch mainline in revision 1593.
  • Revision ID: mbp@sourcefrog.net-20060303064348-d7f474286e006c48
Clean up Transport-based locks for old branches

Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
        self._find_modes()
82
82
        # TODO: remove this and make the parameter mandatory
83
83
        if lock_strategy_class is None:
84
 
            lock_strategy_class = OldTransportLockStrategy
 
84
            lock_strategy_class = TransportLock
85
85
        esc_name = self._escape(lock_name)
86
86
        self._lock_strategy = lock_strategy_class(transport, esc_name)
87
87
 
251
251
        transaction.finish()
252
252
 
253
253
 
254
 
class OldTransportLockStrategy(object):
255
 
    """Old locking method which uses transport-dependent locks.
256
 
 
257
 
    This is not recommended for new code because it doesn't guard 
258
 
    against simultaneous acquisition between different transports.
 
254
class TransportLock(object):
 
255
    """Locking method which uses transport-dependent locks.
 
256
 
 
257
    On the local filesystem these transform into OS-managed locks.
 
258
 
 
259
    These do not guard against concurrent access via different
 
260
    transports.
 
261
 
 
262
    This is suitable for use only in WorkingTrees (which are at present
 
263
    always local).
259
264
    """
260
265
    def __init__(self, transport, escaped_name):
261
266
        self._transport = transport