comparison mercurial/util.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 8ed8dfbeabb9
children 09f3e003fc2a
comparison
equal deleted inserted replaced
44059:7126d8b8e0e6 44060:a61287a95dc3
51 pycompat, 51 pycompat,
52 urllibcompat, 52 urllibcompat,
53 ) 53 )
54 from .utils import ( 54 from .utils import (
55 compression, 55 compression,
56 hashutil,
56 procutil, 57 procutil,
57 stringutil, 58 stringutil,
58 ) 59 )
59 60
60 base85 = policy.importmod('base85') 61 base85 = policy.importmod('base85')
195 warnings.warn(pycompat.sysstr(msg), DeprecationWarning, stacklevel + 1) 196 warnings.warn(pycompat.sysstr(msg), DeprecationWarning, stacklevel + 1)
196 197
197 198
198 DIGESTS = { 199 DIGESTS = {
199 b'md5': hashlib.md5, 200 b'md5': hashlib.md5,
200 b'sha1': hashlib.sha1, 201 b'sha1': hashutil.sha1,
201 b'sha512': hashlib.sha512, 202 b'sha512': hashlib.sha512,
202 } 203 }
203 # List of digest types from strongest to weakest 204 # List of digest types from strongest to weakest
204 DIGESTS_BY_STRENGTH = [b'sha512', b'sha1', b'md5'] 205 DIGESTS_BY_STRENGTH = [b'sha512', b'sha1', b'md5']
205 206