upgrade: implement '__hash__' on 'improvement' class
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Mon, 17 Apr 2017 13:07:31 +0200
changeset 32029 9e35848fa007
parent 32028 99f63f476a72
child 32030 e47223576b8d
upgrade: implement '__hash__' on 'improvement' class The pythonomicon request its implementation.
mercurial/upgrade.py
--- a/mercurial/upgrade.py	Mon Apr 17 13:07:22 2017 +0200
+++ b/mercurial/upgrade.py	Mon Apr 17 13:07:31 2017 +0200
@@ -147,6 +147,9 @@
     def __ne__(self, other):
         return not self == other
 
+    def __hash__(self):
+        return hash(self.name)
+
 def finddeficiencies(repo):
     """returns a list of deficiencies that the repo suffer from"""
     newreporeqs = localrepo.newreporequirements(repo)