obshash: properly cache obshash value
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Wed, 22 Mar 2017 21:28:18 +0100
changeset 2195 bd3d35047181
parent 2194 8e7b2918e1a3
child 2196 2ecc88baabf9
obshash: properly cache obshash value The code was buggy and only cached non-nullid/non-inherited value. This was previous hidden because we were using a 'propertycache' to cache the value on the range object. This fixes it and restore a lot of performance.
hgext3rd/evolve/obsdiscovery.py
--- a/hgext3rd/evolve/obsdiscovery.py	Wed Mar 22 20:59:42 2017 +0100
+++ b/hgext3rd/evolve/obsdiscovery.py	Wed Mar 22 21:28:18 2017 +0100
@@ -444,7 +444,8 @@
         sha = hashlib.sha1()
         for p in pieces:
             sha.update(p)
-        obshash = cache[rangeid] = sha.digest()
+        obshash = sha.digest()
+    cache[rangeid] = obshash
     return obshash
 
 @eh.wrapfunction(obsolete.obsstore, '_addmarkers')