~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
195
195
    def get_physical_lock_status(self):
196
196
        raise NotImplementedError(self.get_physical_lock_status)
197
197
 
 
198
    def leave_lock_in_place(self):
 
199
        """Tell this branch object not to release the physical lock when this
 
200
        object is unlocked.
 
201
        
 
202
        If lock_write doesn't return a token, then this method is not supported.
 
203
        """
 
204
        self.control_files.leave_in_place()
 
205
 
 
206
    def dont_leave_lock_in_place(self):
 
207
        """Tell this branch object to release the physical lock when this
 
208
        object is unlocked, even if it didn't originally acquire it.
 
209
 
 
210
        If lock_write doesn't return a token, then this method is not supported.
 
211
        """
 
212
        self.control_files.dont_leave_in_place()
 
213
 
198
214
    def abspath(self, name):
199
215
        """Return absolute filename for something in the branch
200
216
        
1223
1239
    def is_locked(self):
1224
1240
        return self.control_files.is_locked()
1225
1241
 
1226
 
    def lock_write(self):
1227
 
        self.repository.lock_write()
 
1242
    def lock_write(self, token=None):
 
1243
        repo_token = self.repository.lock_write()
1228
1244
        try:
1229
 
            self.control_files.lock_write()
 
1245
            token = self.control_files.lock_write(token=token)
1230
1246
        except:
1231
1247
            self.repository.unlock()
1232
1248
            raise
 
1249
        return token
1233
1250
 
1234
1251
    def lock_read(self):
1235
1252
        self.repository.lock_read()