~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

Merge bound branch test performance improvements.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1577
1577
        transport = a_bzrdir.get_workingtree_transport(self)
1578
1578
        control_files = self._open_control_files(a_bzrdir)
1579
1579
        control_files.create_lock()
 
1580
        control_files.lock_write()
1580
1581
        control_files.put_utf8('format', self.get_format_string())
1581
1582
        branch = a_bzrdir.open_branch()
1582
1583
        if revision_id is None:
1589
1590
                         _format=self,
1590
1591
                         _bzrdir=a_bzrdir,
1591
1592
                         _control_files=control_files)
1592
 
        wt._write_inventory(inv)
1593
 
        wt.set_root_id(inv.root.file_id)
1594
 
        wt.set_last_revision(revision_id)
1595
 
        wt.set_pending_merges([])
1596
 
        build_tree(wt.basis_tree(), wt)
 
1593
        wt.lock_write()
 
1594
        try:
 
1595
            wt._write_inventory(inv)
 
1596
            wt.set_root_id(inv.root.file_id)
 
1597
            wt.set_last_revision(revision_id)
 
1598
            wt.set_pending_merges([])
 
1599
            build_tree(wt.basis_tree(), wt)
 
1600
        finally:
 
1601
            wt.unlock()
 
1602
            control_files.unlock()
1597
1603
        return wt
1598
1604
 
1599
1605
    def __init__(self):