diff mercurial/scmutil.py @ 47041:a407fe56d6e8

core: don't hard-code hex node lengths Differential Revision: https://phab.mercurial-scm.org/D10535
author Joerg Sonnenberger <joerg@bec.de>
date Fri, 30 Apr 2021 03:09:16 +0200
parents d55b71393907
children bea4717415c0
line wrap: on
line diff
--- a/mercurial/scmutil.py	Mon May 03 02:33:00 2021 +0200
+++ b/mercurial/scmutil.py	Fri Apr 30 03:09:16 2021 +0200
@@ -643,7 +643,7 @@
         except (ValueError, OverflowError, IndexError):
             pass
 
-        if len(symbol) == 40:
+        if len(symbol) == 2 * repo.nodeconstants.nodelen:
             try:
                 node = bin(symbol)
                 rev = repo.changelog.rev(node)