diff mercurial/subrepo.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 e685fac56693
children 2f290136b7d6
line wrap: on
line diff
--- a/mercurial/subrepo.py	Mon Jan 13 17:14:19 2020 -0500
+++ b/mercurial/subrepo.py	Mon Jan 13 17:15:14 2020 -0500
@@ -9,7 +9,6 @@
 
 import copy
 import errno
-import hashlib
 import os
 import re
 import stat
@@ -37,6 +36,7 @@
 )
 from .utils import (
     dateutil,
+    hashutil,
     procutil,
     stringutil,
 )
@@ -61,7 +61,7 @@
 
 def _getstorehashcachename(remotepath):
     '''get a unique filename for the store hash cache of a remote repository'''
-    return node.hex(hashlib.sha1(_expandedabspath(remotepath)).digest())[0:12]
+    return node.hex(hashutil.sha1(_expandedabspath(remotepath)).digest())[0:12]
 
 
 class SubrepoAbort(error.Abort):
@@ -514,7 +514,7 @@
         yield b'# %s\n' % _expandedabspath(remotepath)
         vfs = self._repo.vfs
         for relname in filelist:
-            filehash = node.hex(hashlib.sha1(vfs.tryread(relname)).digest())
+            filehash = node.hex(hashutil.sha1(vfs.tryread(relname)).digest())
             yield b'%s = %s\n' % (relname, filehash)
 
     @propertycache