~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/lockable_files.py

  • Committer: Martin Pool
  • Date: 2010-08-13 07:56:06 UTC
  • mfrom: (5050.17.4 2.2)
  • mto: (5050.17.6 2.2)
  • mto: This revision was merged to the branch mainline in revision 5379.
  • Revision ID: mbp@sourcefrog.net-20100813075606-8zgmov3ezwans2zo
merge bzr 2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
from cStringIO import StringIO
18
 
 
19
17
from bzrlib.lazy_import import lazy_import
20
18
lazy_import(globals(), """
21
19
import codecs
32
30
""")
33
31
 
34
32
from bzrlib.decorators import (
35
 
    needs_read_lock,
36
 
    needs_write_lock,
37
 
    )
38
 
from bzrlib.symbol_versioning import (
39
 
    deprecated_in,
40
 
    deprecated_method,
 
33
    only_raises,
41
34
    )
42
35
 
43
36
 
221
214
        """Setup a write transaction."""
222
215
        self._set_transaction(transactions.WriteTransaction())
223
216
 
 
217
    @only_raises(errors.LockNotHeld, errors.LockBroken)
224
218
    def unlock(self):
225
219
        if not self._lock_mode:
226
220
            return lock.cant_unlock_not_held(self)