~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tree.py

  • Committer: Robert Collins
  • Date: 2006-07-26 03:40:20 UTC
  • mto: (1852.9.6 Tree.compare().)
  • mto: This revision was merged to the branch mainline in revision 1892.
  • Revision ID: robertc@robertcollins.net-20060726034020-06a4bee1b0056675
change Tree.compare to Tree.changes_from - its better for the common case.

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
    trees or versioned trees.
52
52
    """
53
53
    
54
 
    def compare(self, other):
55
 
        """Compare this tree with other.
 
54
    def changes_from(self, other):
 
55
        """Return a TreeDelta of the changes from other to this tree.
56
56
 
57
 
        :param other: A tre to compare with.
 
57
        :param other: A tree to compare with.
58
58
        The comparison will be performed by an InterTree object looked up on 
59
59
        self and other.
60
60
        """
61
 
        return InterTree.get(self, other).compare()
 
61
        # Martin observes that Tree.changes_from returns a TreeDelta and this
 
62
        # may confuse people, because the class name of the returned object is
 
63
        # a synonym of the object referenced in the method name.
 
64
        return InterTree.get(other, self).compare()
62
65
    
63
66
    def conflicts(self):
64
67
        """Get a list of the conflicts in the tree.