~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/lockdir.py

  • Committer: Martin Pool
  • Date: 2006-02-21 22:33:25 UTC
  • mto: This revision was merged to the branch mainline in revision 1569.
  • Revision ID: mbp@sourcefrog.net-20060221223325-0fbe4e9583b6d853
Breaking an already-released lock should just succeed

Show diffs side-by-side

added added

removed removed

Lines of Context:
216
216
        """
217
217
        if self._lock_held:
218
218
            raise AssertionError("can't break own lock: %r" % self)
 
219
        lock_info = self.peek()
 
220
        if lock_info is None:
 
221
            # must have been recently released
 
222
            return
219
223
        tmpname = '%s.broken.%s.tmp' % (self.path, rand_chars(20))
220
224
        self.transport.rename(self.path, tmpname)
221
225
        self.transport.delete(tmpname + self.INFO_NAME)