~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-05-05 08:29:29 UTC
  • mfrom: (1697.1.1 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20060505082929-a037ee137f1ff240
Merge break-lock command.

Show diffs side-by-side

added added

removed removed

Lines of Context:
96
96
    def __init__(self, *ignored, **ignored_too):
97
97
        raise NotImplementedError('The Branch class is abstract')
98
98
 
 
99
    def break_lock(self):
 
100
        """Break a lock if one is present from another instance.
 
101
 
 
102
        Uses the ui factory to ask for confirmation if the lock may be from
 
103
        an active process.
 
104
 
 
105
        This will probe the repository for its lock as well.
 
106
        """
 
107
        self.control_files.break_lock()
 
108
        self.repository.break_lock()
 
109
        master = self.get_master_branch()
 
110
        if master is not None:
 
111
            master.break_lock()
 
112
 
99
113
    @staticmethod
100
114
    @deprecated_method(zero_eight)
101
115
    def open_downlevel(base):
961
975
 
962
976
    def unlock(self):
963
977
        # TODO: test for failed two phase locks. This is known broken.
964
 
        self.repository.unlock()
965
 
        self.control_files.unlock()
 
978
        try:
 
979
            self.repository.unlock()
 
980
        finally:
 
981
            self.control_files.unlock()
966
982
        
967
983
    def peek_lock_mode(self):
968
984
        if self.control_files._lock_count == 0: