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

  • Committer: Jelmer Vernooij
  • Date: 2019-07-27 22:47:49 UTC
  • mfrom: (7377 work)
  • mto: This revision was merged to the branch mainline in revision 7378.
  • Revision ID: jelmer@jelmer.uk-20190727224749-rta5fv1sc4ivy6ko
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
399
399
                parents.append(revision_id)
400
400
        return parents
401
401
 
402
 
    def get_root_id(self):
403
 
        """Return the id of this trees root"""
404
 
        raise NotImplementedError(self.get_root_id)
405
 
 
406
402
    def clone(self, to_controldir, revision_id=None):
407
403
        """Duplicate this working tree into to_bzr, including all state.
408
404
 
425
421
    def copy_content_into(self, tree, revision_id=None):
426
422
        """Copy the current content and user files of this tree into tree."""
427
423
        with self.lock_read():
428
 
            tree.set_root_id(self.get_root_id())
 
424
            tree.set_root_id(self.path2id(''))
429
425
            if revision_id is None:
430
426
                merge.transform_tree(tree, self)
431
427
            else:
842
838
                        this_tree=self,
843
839
                        change_reporter=change_reporter,
844
840
                        show_base=show_base)
845
 
                    basis_root_id = basis_tree.get_root_id()
846
 
                    new_root_id = new_basis_tree.get_root_id()
 
841
                    basis_root_id = basis_tree.path2id('')
 
842
                    new_root_id = new_basis_tree.path2id('')
847
843
                    if new_root_id is not None and basis_root_id != new_root_id:
848
844
                        self.set_root_id(new_root_id)
849
845
                # TODO - dedup parents list with things merged by pull ?
1168
1164
                # the working tree is up to date with the branch
1169
1165
                # we can merge the specified revision from master
1170
1166
                to_tree = self.branch.repository.revision_tree(revision)
1171
 
                to_root_id = to_tree.get_root_id()
 
1167
                to_root_id = to_tree.path2id('')
1172
1168
 
1173
1169
                basis = self.basis_tree()
1174
1170
                with basis.lock_read():
1175
 
                    if (basis.get_root_id() is None or basis.get_root_id() != to_root_id):
 
1171
                    if (basis.path2id('') is None or basis.path2id('') != to_root_id):
1176
1172
                        self.set_root_id(to_root_id)
1177
1173
                        self.flush()
1178
1174