stablerange: remove the now unused individual range class
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Wed, 22 Mar 2017 21:09:28 +0100
changeset 2197 c4ece9c98dc4
parent 2196 2ecc88baabf9
child 2198 ab392bd1c518
stablerange: remove the now unused individual range class That class is now longer necessary, we dropped its usage for performance reason.
hgext3rd/evolve/stablerange.py
--- a/hgext3rd/evolve/stablerange.py	Wed Mar 22 21:08:58 2017 +0100
+++ b/hgext3rd/evolve/stablerange.py	Wed Mar 22 21:09:28 2017 +0100
@@ -16,7 +16,6 @@
     localrepo,
     node as nodemod,
     scmutil,
-    util,
 )
 
 from mercurial.i18n import _
@@ -392,42 +391,6 @@
     """return highest power of two lower than 'i'"""
     return 2 ** int(math.log(i - 1, 2))
 
-class stablerange(object):
-
-    def __init__(self, repo, head, index, revs=None):
-        self._repo = repo.unfiltered()
-        self._head = head
-        self._index = index
-        if revs is not None:
-            self._repo.stablerange._revsinrangecache[self] = revs
-        # sanity checking
-        if revs is not None:
-            length = self._repo.stablerange.rangelength(self._repo, self)
-            assert len(revs) == length
-        depth = self._repo.stablerange.depthrev(self._repo, self[0])
-        assert index < depth, (head, index, depth, revs)
-
-    def __hash__(self):
-        return hash((self._head, self._index))
-
-    def __eq__(self, other):
-        if type(self) != type(other):
-            raise NotImplementedError()
-        return (self._head, self._index) == (other._head, other._index)
-
-    def __getitem__(self, idx):
-        """small helper function to prepare for the migration to tuple"""
-        if idx == 0:
-            return self._head
-        elif idx == 1:
-            return self._index
-        else:
-            raise IndexError(idx)
-
-    @util.propertycache
-    def _revs(self):
-        return self._repo.stablerange.revsfromrange(self._repo, self)
-
 @eh.reposetup
 def setupcache(ui, repo):