~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/lockable_files.py

  • Committer: Martin Pool
  • Date: 2006-02-22 04:29:54 UTC
  • mfrom: (1566 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1569.
  • Revision ID: mbp@sourcefrog.net-20060222042954-60333f08dd56a646
[merge] from bzr.dev before integration
Fix undefined ordering in sign_my_revisions breaking tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 6 Canonical Ltd
 
1
# Copyright (C) 2005, 2006 Canonical Ltd
2
2
 
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
162
162
        self.put(path, StringIO(a_string.encode('utf-8')))
163
163
 
164
164
    def lock_write(self):
165
 
        mutter("lock write: %s (%s)", self, self._lock_count)
 
165
        # mutter("lock write: %s (%s)", self, self._lock_count)
166
166
        # TODO: Upgrade locking to support using a Transport,
167
167
        # and potentially a remote locking protocol
168
168
        if self._lock_mode:
177
177
            self._set_transaction(transactions.PassThroughTransaction())
178
178
 
179
179
    def lock_read(self):
180
 
        mutter("lock read: %s (%s)", self, self._lock_count)
 
180
        # mutter("lock read: %s (%s)", self, self._lock_count)
181
181
        if self._lock_mode:
182
182
            assert self._lock_mode in ('r', 'w'), \
183
183
                   "invalid lock mode %r" % self._lock_mode
192
192
            self.get_transaction().set_cache_size(5000)
193
193
                        
194
194
    def unlock(self):
195
 
        mutter("unlock: %s (%s)", self, self._lock_count)
 
195
        # mutter("unlock: %s (%s)", self, self._lock_count)
196
196
        if not self._lock_mode:
197
 
            raise BranchNotLocked(self)
198
 
 
 
197
            raise errors.BranchNotLocked(self)
199
198
        if self._lock_count > 1:
200
199
            self._lock_count -= 1
201
200
        else: