stablerange: stop using '.node' in _queryrange
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Wed, 22 Mar 2017 06:05:44 +0100
changeset 2146 4df68eb96adf
parent 2145 4c0c88e51018
child 2147 5179668d9f47
stablerange: stop using '.node' in _queryrange We access the range-head revision number by index and convert it on site.
hgext3rd/evolve/obsdiscovery.py
--- a/hgext3rd/evolve/obsdiscovery.py	Wed Mar 22 06:05:32 2017 +0100
+++ b/hgext3rd/evolve/obsdiscovery.py	Wed Mar 22 06:05:44 2017 +0100
@@ -322,10 +322,12 @@
 
 def _queryrange(ui, repo, remote, allentries):
     mapping = {}
+    n = repo.changelog.node
+    nodeentries = [(n(entry[0]), entry.index, entry) for entry in allentries]
 
     def gen():
-        for entry in allentries:
-            key = entry.node + _pack('>I', entry.index)
+        for enode, eindex, entry in nodeentries:
+            key = enode + _pack('>I', eindex)
             mapping[key] = entry
             yield key