~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/lock.py

Abbreviate pack_stat struct format to '>6L'

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
    trace,
47
47
    )
48
48
from bzrlib.hooks import Hooks
49
 
 
 
49
from bzrlib.i18n import gettext
50
50
 
51
51
class LockHooks(Hooks):
52
52
 
171
171
            self.f.close()
172
172
            self.f = None
173
173
 
174
 
    def __del__(self):
175
 
        if self.f:
176
 
            from warnings import warn
177
 
            warn("lock on %r not released" % self.f)
178
 
            self.unlock()
179
 
 
180
174
    def unlock(self):
181
175
        raise NotImplementedError()
182
176
 
541
535
    locked the same way), and -Drelock is set, then this will trace.note a
542
536
    message about it.
543
537
    """
544
 
    
 
538
 
545
539
    _prev_lock = None
546
540
 
547
541
    def _note_lock(self, lock_type):
550
544
                type_name = 'read'
551
545
            else:
552
546
                type_name = 'write'
553
 
            trace.note('%r was %s locked again', self, type_name)
 
547
            trace.note(gettext('{0!r} was {1} locked again'), self, type_name)
554
548
        self._prev_lock = lock_type
555
549