~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

  • Committer: Aaron Bentley
  • Date: 2006-09-27 05:22:01 UTC
  • mto: (2100.3.5 by-reference-trees)
  • mto: This revision was merged to the branch mainline in revision 2322.
  • Revision ID: aaron.bentley@utoronto.ca-20060927052201-2256fa7dc07a50ac
Test subsume failure modes

Show diffs side-by-side

added added

removed removed

Lines of Context:
805
805
 
806
806
    @needs_write_lock
807
807
    def subsume(self, other_tree):
808
 
        other_tree_path = self.relpath(other_tree.basedir)
 
808
        if other_tree.get_root_id() == self.get_root_id():
 
809
            raise errors.BadSubsumeTarget(self, other_tree, 
 
810
                                          'Trees have the same root')
 
811
        try:
 
812
            other_tree_path = self.relpath(other_tree.basedir)
 
813
        except errors.PathNotChild:
 
814
            raise errors.BadSubsumeTarget(self, other_tree, 
 
815
                'Tree is not contained by the other')
809
816
        other_root = other_tree.inventory.root
810
817
        other_root.parent_id = self.path2id(osutils.dirname(other_tree_path))
811
818
        assert other_root.parent_id is not None