/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/workingtree.py

  • Committer: v.ladeuil+lp at free
  • Date: 2006-10-19 08:44:55 UTC
  • mfrom: (2091 +trunk)
  • mto: (2145.1.1 keepalive)
  • mto: This revision was merged to the branch mainline in revision 2146.
  • Revision ID: v.ladeuil+lp@free.fr-20061019084455-89d30e66e82b1e52
Merge bzr,dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
423
423
                xml = self.read_basis_inventory()
424
424
                inv = xml6.serializer_v6.read_inventory_from_string(xml)
425
425
                if inv is not None and inv.revision_id == revision_id:
426
 
                    return bzrlib.tree.RevisionTree(self.branch.repository,
427
 
                                                    inv, revision_id)
 
426
                    return bzrlib.revisiontree.RevisionTree(
 
427
                        self.branch.repository, inv, revision_id)
428
428
            except (NoSuchFile, errors.BadInventoryFormat):
429
429
                pass
430
430
        # No cached copy available, retrieve from the repository.
1641
1641
        """
1642
1642
        raise NotImplementedError(self.unlock)
1643
1643
 
1644
 
    @needs_write_lock
1645
1644
    def update(self):
1646
1645
        """Update a working tree along its branch.
1647
1646
 
1667
1666
          basis.
1668
1667
        - Do a 'normal' merge of the old branch basis if it is relevant.
1669
1668
        """
1670
 
        old_tip = self.branch.update()
1671
 
 
 
1669
        if self.branch.get_master_branch() is not None:
 
1670
            self.lock_write()
 
1671
            update_branch = True
 
1672
        else:
 
1673
            self.lock_tree_write()
 
1674
            update_branch = False
 
1675
        try:
 
1676
            if update_branch:
 
1677
                old_tip = self.branch.update()
 
1678
            else:
 
1679
                old_tip = None
 
1680
            return self._update_tree(old_tip)
 
1681
        finally:
 
1682
            self.unlock()
 
1683
 
 
1684
    @needs_tree_write_lock
 
1685
    def _update_tree(self, old_tip=None):
 
1686
        """Update a tree to the master branch.
 
1687
 
 
1688
        :param old_tip: if supplied, the previous tip revision the branch,
 
1689
            before it was changed to the master branch's tip.
 
1690
        """
1672
1691
        # here if old_tip is not None, it is the old tip of the branch before
1673
1692
        # it was updated from the master branch. This should become a pending
1674
1693
        # merge in the working tree to preserve the user existing work.  we
2100
2119
        branch = a_bzrdir.open_branch()
2101
2120
        if revision_id is None:
2102
2121
            revision_id = branch.last_revision()
2103
 
        inv = Inventory(root_id=gen_root_id())
 
2122
        # WorkingTree3 can handle an inventory which has a unique root id.
 
2123
        # as of bzr 0.12. However, bzr 0.11 and earlier fail to handle
 
2124
        # those trees. And because there isn't a format bump inbetween, we
 
2125
        # are maintaining compatibility with older clients.
 
2126
        # inv = Inventory(root_id=gen_root_id())
 
2127
        inv = Inventory()
2104
2128
        wt = WorkingTree3(a_bzrdir.root_transport.local_abspath('.'),
2105
2129
                         branch,
2106
2130
                         inv,