mercurial/context.py
changeset 6469 fb502719c75c
parent 6286 90a4329a6b4a
child 6529 0c611355481b
--- a/mercurial/context.py	Fri Apr 04 22:18:38 2008 +0200
+++ b/mercurial/context.py	Fri Apr 04 22:41:17 2008 +0200
@@ -34,6 +34,12 @@
     def __repr__(self):
         return "<changectx %s>" % str(self)
 
+    def __hash__(self):
+        try:
+            return hash(self._rev)
+        except AttributeError:
+            return id(self)
+
     def __eq__(self, other):
         try:
             return self._rev == other._rev
@@ -210,6 +216,12 @@
     def __repr__(self):
         return "<filectx %s>" % str(self)
 
+    def __hash__(self):
+        try:
+            return hash((self._path, self._fileid))
+        except AttributeError:
+            return id(self)
+
     def __eq__(self, other):
         try:
             return (self._path == other._path