~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/lockdir.py

  • Committer: Joe Julian
  • Date: 2010-01-10 02:25:31 UTC
  • mto: (4634.119.7 2.0)
  • mto: This revision was merged to the branch mainline in revision 4959.
  • Revision ID: joe@julianfamily.org-20100110022531-wqk61rsagz8xsiga
Added MANIFEST.in to allow bdist_rpm to have all the required include files and tools. bdist_rpm will still fail to build correctly on some distributions due to a disttools bug http://bugs.python.org/issue644744

Show diffs side-by-side

added added

removed removed

Lines of Context:
240
240
        # incorrect.  It's possible some other servers or filesystems will
241
241
        # have a similar bug allowing someone to think they got the lock
242
242
        # when it's already held.
 
243
        #
 
244
        # See <https://bugs.edge.launchpad.net/bzr/+bug/498378> for one case.
 
245
        #
 
246
        # Strictly the check is unnecessary and a waste of time for most
 
247
        # people, but probably worth trapping if something is wrong.
243
248
        info = self.peek()
244
249
        self._trace("after locking, info=%r", info)
 
250
        if info is None:
 
251
            raise LockFailed(self, "lock was renamed into place, but "
 
252
                "now is missing!")
245
253
        if info['nonce'] != self.nonce:
246
254
            self._trace("rename succeeded, "
247
255
                "but lock is still held by someone else")
293
301
            self._fake_read_lock = False
294
302
            return
295
303
        if not self._lock_held:
296
 
            raise LockNotHeld(self)
 
304
            return lock.cant_unlock_not_held(self)
297
305
        if self._locked_via_token:
298
306
            self._locked_via_token = False
299
307
            self._lock_held = False
325
333
            self._trace("... unlock succeeded after %dms",
326
334
                    (time.time() - start_time) * 1000)
327
335
            result = lock.LockResult(self.transport.abspath(self.path),
328
 
                old_nonce)
 
336
                                     old_nonce)
329
337
            for hook in self.hooks['lock_released']:
330
338
                hook(result)
331
339
 
379
387
            raise LockBreakMismatch(self, broken_info, dead_holder_info)
380
388
        self.transport.delete(broken_info_path)
381
389
        self.transport.rmdir(tmpname)
 
390
        result = lock.LockResult(self.transport.abspath(self.path),
 
391
                                 current_info.get('nonce'))
 
392
        for hook in self.hooks['lock_broken']:
 
393
            hook(result)
382
394
 
383
395
    def _check_not_locked(self):
384
396
        """If the lock is held by this instance, raise an error."""