/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 breezy/counted_lock.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2020-08-23 01:15:41 UTC
  • mfrom: (7520.1.4 merge-3.1)
  • Revision ID: breezy.the.bot@gmail.com-20200823011541-nv0oh7nzaganx2qy
Merge lp:brz/3.1.

Merged from https://code.launchpad.net/~jelmer/brz/merge-3.1/+merge/389690

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Counted lock class"""
18
18
 
19
 
 
20
 
from bzrlib import (
 
19
from . import (
21
20
    errors,
22
21
    )
23
22
 
28
27
    This can be used with any object that provides a basic Lock interface,
29
28
    including LockDirs and OS file locks.
30
29
 
31
 
    :ivar _token: While a write lock is held, this is the token 
 
30
    :ivar _token: While a write lock is held, this is the token
32
31
        for it.
33
32
    """
34
33
 
39
38
 
40
39
    def __repr__(self):
41
40
        return "%s(%r)" % (self.__class__.__name__,
42
 
            self._real_lock)
 
41
                           self._real_lock)
43
42
 
44
43
    def break_lock(self):
45
44
        self._real_lock.break_lock()
80
79
 
81
80
        If the lock was originally acquired in read mode this will fail.
82
81
 
83
 
        :param token: If given and the lock is already held, 
 
82
        :param token: If given and the lock is already held,
84
83
            then validate that we already hold the real
85
84
            lock with this token.
86
85