Implement ShaFile.__ne__.
authorJelmer Vernooij <jelmer@samba.org>
Tue, 9 Jun 2009 20:53:03 +0000 (22:53 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Tue, 9 Jun 2009 20:53:03 +0000 (22:53 +0200)
dulwich/objects.py

index a4c7bfbac39c2893b30e8b659c7f184d57ee3e75..928366a5c2dbb6f985ed835de77e3e7814289a2e 100644 (file)
@@ -226,6 +226,9 @@ class ShaFile(object):
   
     def __repr__(self):
         return "<%s %s>" % (self.__class__.__name__, self.id)
+
+    def __ne__(self, other):
+        return self.id != other.id
   
     def __eq__(self, other):
         """Return true id the sha of the two objects match.
@@ -233,7 +236,7 @@ class ShaFile(object):
         The __le__ etc methods aren't overriden as they make no sense,
         certainly at this level.
         """
-        return self.sha().digest() == other.sha().digest()
+        return self.id == other.id
 
 
 class Blob(ShaFile):