/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/commit.py

DirstateRevisionTrees need to be read_locked before they will work as BasisTree

Show diffs side-by-side

added added

removed removed

Lines of Context:
236
236
 
237
237
        self.work_tree.lock_write()
238
238
        self.pb = bzrlib.ui.ui_factory.nested_progress_bar()
 
239
        self.basis_tree = self.work_tree.basis_tree()
 
240
        self.basis_tree.lock_read()
239
241
        try:
240
242
            # Cannot commit with conflicts present.
241
243
            if len(self.work_tree.conflicts())>0:
267
269
                self.config = self.branch.get_config()
268
270
 
269
271
            self.work_inv = self.work_tree.inventory
270
 
            self.basis_tree = self.work_tree.basis_tree()
271
272
            self.basis_inv = self.basis_tree.inventory
272
273
            if specific_files is not None:
273
274
                # Ensure specified files are versioned
443
444
    def _cleanup(self):
444
445
        """Cleanup any open locks, progress bars etc."""
445
446
        cleanups = [self._cleanup_bound_branch,
 
447
                    self.basis_tree.unlock,
446
448
                    self.work_tree.unlock,
447
449
                    self.pb.finished]
448
450
        found_exception = None