comparison mercurial/wireprotov2server.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 89a2afe31e82
comparison
equal deleted inserted replaced
44059:7126d8b8e0e6 44060:a61287a95dc3
6 6
7 from __future__ import absolute_import 7 from __future__ import absolute_import
8 8
9 import collections 9 import collections
10 import contextlib 10 import contextlib
11 import hashlib
12 11
13 from .i18n import _ 12 from .i18n import _
14 from .node import ( 13 from .node import (
15 hex, 14 hex,
16 nullid, 15 nullid,
29 wireprototypes, 28 wireprototypes,
30 ) 29 )
31 from .interfaces import util as interfaceutil 30 from .interfaces import util as interfaceutil
32 from .utils import ( 31 from .utils import (
33 cborutil, 32 cborutil,
33 hashutil,
34 stringutil, 34 stringutil,
35 ) 35 )
36 36
37 FRAMINGTYPE = b'application/mercurial-exp-framing-0006' 37 FRAMINGTYPE = b'application/mercurial-exp-framing-0006'
38 38
856 if allargs: 856 if allargs:
857 state[b'args'] = pycompat.byteskwargs(args) 857 state[b'args'] = pycompat.byteskwargs(args)
858 858
859 cacher.adjustcachekeystate(state) 859 cacher.adjustcachekeystate(state)
860 860
861 hasher = hashlib.sha1() 861 hasher = hashutil.sha1()
862 for chunk in cborutil.streamencode(state): 862 for chunk in cborutil.streamencode(state):
863 hasher.update(chunk) 863 hasher.update(chunk)
864 864
865 return pycompat.sysbytes(hasher.hexdigest()) 865 return pycompat.sysbytes(hasher.hexdigest())
866 866