diff --git a/contrib/perf.py b/contrib/perf.py --- a/contrib/perf.py +++ b/contrib/perf.py @@ -861,7 +861,21 @@ ctx = scmutil.revsingle(repo, rev, rev) t = ctx.manifestnode() else: - t = repo.manifestlog._revlog.lookup(rev) + from mercurial.node import bin + + if len(rev) == 40: + t = bin(rev) + else: + try: + rev = int(rev) + + if util.safehasattr(repo.manifestlog, 'getstorage'): + t = repo.manifestlog.getstorage(b'').node(rev) + else: + t = repo.manifestlog._revlog.lookup(rev) + except ValueError: + raise error.Abort('manifest revision must be integer or full ' + 'node') def d(): repo.manifestlog.clearcaches(clear_persisted_data=clear_disk) repo.manifestlog[t].read() diff --git a/tests/test-contrib-perf.t b/tests/test-contrib-perf.t --- a/tests/test-contrib-perf.t +++ b/tests/test-contrib-perf.t @@ -166,6 +166,10 @@ $ hg perflookup 2 $ hg perflrucache $ hg perfmanifest 2 + $ hg perfmanifest -m 44fe2c8352bb3a478ffd7d8350bbc721920134d1 + $ hg perfmanifest -m 44fe2c8352bb + abort: manifest revision must be integer or full node + [255] $ hg perfmergecalculate -r 3 $ hg perfmoonwalk $ hg perfnodelookup 2