~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

  • Committer: Robert Collins
  • Date: 2006-05-04 13:01:28 UTC
  • mto: (1697.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 1701.
  • Revision ID: robertc@robertcollins.net-20060504130128-32da543d660b7061
Teach WorkingTree about break-lock.

Show diffs side-by-side

added added

removed removed

Lines of Context:
290
290
            the working tree has been constructed from.
291
291
            """)
292
292
 
 
293
    def break_lock(self):
 
294
        """Break a lock if one is present from another instance.
 
295
 
 
296
        Uses the ui factory to ask for confirmation if the lock may be from
 
297
        an active process.
 
298
 
 
299
        This will probe the repository for its lock as well.
 
300
        """
 
301
        self._control_files.break_lock()
 
302
        self.branch.break_lock()
 
303
 
293
304
    def _set_inventory(self, inv):
294
305
        self._inventory = inv
295
306
        self.path2id = self._inventory.path2id
1229
1240
             self._control_files._lock_count==3)):
1230
1241
            self._hashcache.write()
1231
1242
        # reverse order of locking.
1232
 
        result = self._control_files.unlock()
1233
1243
        try:
 
1244
            return self._control_files.unlock()
 
1245
        finally:
1234
1246
            self.branch.unlock()
1235
 
        finally:
1236
 
            return result
1237
1247
 
1238
1248
    @needs_write_lock
1239
1249
    def update(self):