/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: Jelmer Vernooij
  • Date: 2020-04-05 19:11:34 UTC
  • mto: (7490.7.16 work)
  • mto: This revision was merged to the branch mainline in revision 7501.
  • Revision ID: jelmer@jelmer.uk-20200405191134-0aebh8ikiwygxma5
Populate the .gitignore file.

Show diffs side-by-side

added added

removed removed

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