stablerange: make sure nobody use the 'stablekey' property outside the class
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Wed, 22 Mar 2017 17:48:39 +0100
changeset 2156 e57f28fafe41
parent 2155 89ce52e855ed
child 2157 e3b75a5d6b38
stablerange: make sure nobody use the 'stablekey' property outside the class
hgext3rd/evolve/stablerange.py
--- a/hgext3rd/evolve/stablerange.py	Wed Mar 22 17:47:09 2017 +0100
+++ b/hgext3rd/evolve/stablerange.py	Wed Mar 22 17:48:39 2017 +0100
@@ -357,7 +357,7 @@
     def __eq__(self, other):
         if type(self) != type(other):
             raise NotImplementedError()
-        return self.stablekey == other.stablekey
+        return self._stablekey == other._stablekey
 
     def __getitem__(self, idx):
         """small helper function to prepare for the migration to tuple"""
@@ -370,10 +370,10 @@
 
     @util.propertycache
     def _id(self):
-        return hash(self.stablekey)
+        return hash(self._stablekey)
 
     @util.propertycache
-    def stablekey(self):
+    def _stablekey(self):
         return (self[0], self.index)
 
     def __len__(self):