~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/diff.py

  • Committer: Martin Pool
  • Date: 2005-06-22 07:56:30 UTC
  • Revision ID: mbp@sourcefrog.net-20050622075630-b65f447986479cc6
- TreeDelta __eq__ and __ne__ methods

Show diffs side-by-side

added added

removed removed

Lines of Context:
276
276
        self.modified = []
277
277
        self.unchanged = []
278
278
 
 
279
    def __eq__(self, other):
 
280
        if not isinstance(other, TreeDelta):
 
281
            return False
 
282
        return self.added == other.added \
 
283
               and self.removed == other.removed \
 
284
               and self.renamed == other.renamed \
 
285
               and self.modified == other.modified \
 
286
               and self.unchanged == other.unchanged
 
287
 
 
288
    def __ne__(self, other):
 
289
        return not (self == other)
 
290
 
279
291
    def __repr__(self):
280
292
        return "TreeDelta(added=%r, removed=%r, renamed=%r, modified=%r," \
281
293
            " unchanged=%r)" % (self.added, self.removed, self.renamed,