~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/lockdir.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-09-26 14:39:52 UTC
  • mfrom: (5387.2.9 2.3-filter-tests)
  • Revision ID: pqm@pqm.ubuntu.com-20100926143952-qdatcpmr3xkus9h2
(jameinel) Remove 'log' information from "successful" tests (John A Meinel)

Show diffs side-by-side

added added

removed removed

Lines of Context:
347
347
        This is a UI centric function: it uses the bzrlib.ui.ui_factory to
348
348
        prompt for input if a lock is detected and there is any doubt about
349
349
        it possibly being still active.
350
 
 
351
 
        :returns: LockResult for the broken lock.
352
350
        """
353
351
        self._check_not_locked()
354
352
        try:
363
361
            if bzrlib.ui.ui_factory.confirm_action(
364
362
                "Break %(lock_info)s", 'bzrlib.lockdir.break', 
365
363
                dict(lock_info=lock_info)):
366
 
                result = self.force_break(holder_info)
367
 
                bzrlib.ui.ui_factory.show_message(
368
 
                    "Broke lock %s" % result.lock_url)
 
364
                self.force_break(holder_info)
369
365
 
370
366
    def force_break(self, dead_holder_info):
371
367
        """Release a lock held by another process.
382
378
        After the lock is broken it will not be held by any process.
383
379
        It is possible that another process may sneak in and take the
384
380
        lock before the breaking process acquires it.
385
 
 
386
 
        :returns: LockResult for the broken lock.
387
381
        """
388
382
        if not isinstance(dead_holder_info, dict):
389
383
            raise ValueError("dead_holder_info: %r" % dead_holder_info)
409
403
                                 current_info.get('nonce'))
410
404
        for hook in self.hooks['lock_broken']:
411
405
            hook(result)
412
 
        return result
413
406
 
414
407
    def force_break_corrupt(self, corrupt_info_lines):
415
408
        """Release a lock that has been corrupted.