obsolete: add __eq__ and __hash__ to marker to make set() deduplication work
authorAugie Fackler <raf@durin42.com>
Sat, 16 Nov 2013 20:12:02 -0500
changeset 20031 6c1adf2067bb
parent 20030 5931489b65e0
child 20032 175c6fd8cacc
obsolete: add __eq__ and __hash__ to marker to make set() deduplication work
mercurial/obsolete.py
--- a/mercurial/obsolete.py	Sat Nov 16 20:31:58 2013 -0500
+++ b/mercurial/obsolete.py	Sat Nov 16 20:12:02 2013 -0500
@@ -196,6 +196,14 @@
         self._data = data
         self._decodedmeta = None
 
+    def __hash__(self):
+        return hash(self._data)
+
+    def __eq__(self, other):
+        if type(other) != type(self):
+            return False
+        return self._data == other._data
+
     def precnode(self):
         """Precursor changeset node identifier"""
         return self._data[0]