changeset 2195:bd3d35047181

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.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Wed, 22 Mar 2017 21:28:18 +0100
parents 8e7b2918e1a3
children 2ecc88baabf9
files hgext3rd/evolve/obsdiscovery.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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')