diff mercurial/sparse.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 8ff1ecfadcd1
children b7808443ed6a
line wrap: on
line diff
--- a/mercurial/sparse.py	Mon Jan 13 17:14:19 2020 -0500
+++ b/mercurial/sparse.py	Mon Jan 13 17:15:14 2020 -0500
@@ -7,7 +7,6 @@
 
 from __future__ import absolute_import
 
-import hashlib
 import os
 
 from .i18n import _
@@ -24,6 +23,7 @@
     scmutil,
     util,
 )
+from .utils import hashutil
 
 # Whether sparse features are enabled. This variable is intended to be
 # temporary to facilitate porting sparse to core. It should eventually be
@@ -205,12 +205,12 @@
         tempsignature = b'0'
 
     if signature is None or (includetemp and tempsignature is None):
-        signature = hex(hashlib.sha1(repo.vfs.tryread(b'sparse')).digest())
+        signature = hex(hashutil.sha1(repo.vfs.tryread(b'sparse')).digest())
         cache[b'signature'] = signature
 
         if includetemp:
             raw = repo.vfs.tryread(b'tempsparse')
-            tempsignature = hex(hashlib.sha1(raw).digest())
+            tempsignature = hex(hashutil.sha1(raw).digest())
             cache[b'tempsignature'] = tempsignature
 
     return b'%s %s' % (signature, tempsignature)