shortest: avoid magic number "41"
As suggested by Yuya. Feel free to fold into D3502.
Differential Revision: https://phab.mercurial-scm.org/D3531
--- a/mercurial/scmutil.py Fri May 11 07:31:51 2018 -0700
+++ b/mercurial/scmutil.py Fri May 11 09:16:26 2018 -0700
@@ -466,7 +466,7 @@
def disambiguate(prefix):
"""Disambiguate against revnums."""
hexnode = hex(node)
- for length in range(len(prefix), 41):
+ for length in range(len(prefix), len(hexnode) + 1):
prefix = hexnode[:length]
if not isrev(prefix):
return prefix