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

  • Committer: Richard Wilbur
  • Date: 2016-02-04 19:07:28 UTC
  • mto: This revision was merged to the branch mainline in revision 6618.
  • Revision ID: richard.wilbur@gmail.com-20160204190728-p0zvfii6zase0fw7
Update COPYING.txt from the original http://www.gnu.org/licenses/gpl-2.0.txt  (Only differences were in whitespace.)  Thanks to Petr Stodulka for pointing out the discrepancy.

Show diffs side-by-side

added added

removed removed

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