diff mercurial/store.py @ 44060:a61287a95dc3

core: migrate uses of hashlib.sha1 to hashutil.sha1 Differential Revision: https://phab.mercurial-scm.org/D7849
author Augie Fackler <augie@google.com>
date Mon, 13 Jan 2020 17:15:14 -0500
parents 9f70512ae2cf
children 9d2b2df2c2ba
line wrap: on
line diff
--- a/mercurial/store.py	Mon Jan 13 17:14:19 2020 -0500
+++ b/mercurial/store.py	Mon Jan 13 17:15:14 2020 -0500
@@ -9,7 +9,6 @@
 
 import errno
 import functools
-import hashlib
 import os
 import stat
 
@@ -25,6 +24,7 @@
     util,
     vfs as vfsmod,
 )
+from .utils import hashutil
 
 parsers = policy.importmod('parsers')
 # how much bytes should be read from fncache in one read
@@ -273,7 +273,7 @@
 
 
 def _hashencode(path, dotencode):
-    digest = node.hex(hashlib.sha1(path).digest())
+    digest = node.hex(hashutil.sha1(path).digest())
     le = lowerencode(path[5:]).split(b'/')  # skips prefix 'data/' or 'meta/'
     parts = _auxencode(le, dotencode)
     basename = parts[-1]