# HG changeset patch # User Pierre-Yves David # Date 1490207423 -3600 # Node ID eea1fdeb1eb33284af7d95e76f3eb8990c640995 # Parent 7570e06834604b6add92ed73519312e70007f00d stablerange: drop "key" and "id" logic form the class We can restrict to the bare minimun for equality and hashing now. diff -r 7570e0683460 -r eea1fdeb1eb3 hgext3rd/evolve/stablerange.py --- a/hgext3rd/evolve/stablerange.py Wed Mar 22 19:28:14 2017 +0100 +++ b/hgext3rd/evolve/stablerange.py Wed Mar 22 19:30:23 2017 +0100 @@ -352,12 +352,12 @@ assert index < depth, (head, index, depth, revs) def __hash__(self): - return self._id + return hash((self._head, self._index)) def __eq__(self, other): if type(self) != type(other): raise NotImplementedError() - return self._stablekey == other._stablekey + return (self._head, self._index) == (other._head, other._index) def __getitem__(self, idx): """small helper function to prepare for the migration to tuple""" @@ -369,14 +369,6 @@ raise IndexError(idx) @util.propertycache - def _id(self): - return hash(self._stablekey) - - @util.propertycache - def _stablekey(self): - return (self[0], self[1]) - - @util.propertycache def _revs(self): length = self._repo.stablerange.rangelength(self._repo, self) r = stablesort(self._repo, [self[0]])[self[1]:]