perf: make `perfnodemap` use the new `index.get_rev` api if available
Differential Revision: https://phab.mercurial-scm.org/D7358
--- a/contrib/perf.py Sat Nov 09 13:23:54 2019 +0100
+++ b/contrib/perf.py Sat Nov 09 13:23:54 2019 +0100
@@ -1629,7 +1629,11 @@
def setnodeget():
# probably not necessary, but for good measure
clearchangelog(unfi)
- nodeget[0] = makecl(unfi).nodemap.get
+ cl = makecl(unfi)
+ if util.safehasattr(cl.index, 'get_rev'):
+ nodeget[0] = cl.index.get_rev
+ else:
+ nodeget[0] = cl.nodemap.get
def d():
get = nodeget[0]