changeset 20031:6c1adf2067bb

obsolete: add __eq__ and __hash__ to marker to make set() deduplication work
author Augie Fackler <raf@durin42.com>
date Sat, 16 Nov 2013 20:12:02 -0500
parents 5931489b65e0
children 175c6fd8cacc
files mercurial/obsolete.py
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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]