~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

Fix tree unlock on readonly Format4 trees with dirty hashcache.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1838
1838
        if last_rev != self.branch.last_revision():
1839
1839
            # merge tree state up to new branch tip.
1840
1840
            basis = self.basis_tree()
1841
 
            to_tree = self.branch.basis_tree()
1842
 
            if basis.inventory.root is None:
1843
 
                self.set_root_id(to_tree.inventory.root.file_id)
1844
 
            result += merge.merge_inner(
1845
 
                                  self.branch,
1846
 
                                  to_tree,
1847
 
                                  basis,
1848
 
                                  this_tree=self)
 
1841
            basis.lock_read()
 
1842
            try:
 
1843
                to_tree = self.branch.basis_tree()
 
1844
                if basis.inventory.root is None:
 
1845
                    self.set_root_id(to_tree.inventory.root.file_id)
 
1846
                result += merge.merge_inner(
 
1847
                                      self.branch,
 
1848
                                      to_tree,
 
1849
                                      basis,
 
1850
                                      this_tree=self)
 
1851
            finally:
 
1852
                basis.unlock()
1849
1853
            # TODO - dedup parents list with things merged by pull ?
1850
1854
            # reuse the tree we've updated to to set the basis:
1851
1855
            parent_trees = [(self.branch.last_revision(), to_tree)]