comparison mercurial/wireproto.py @ 29341:0d83ad967bf8

cleanup: replace uses of util.(md5|sha1|sha256|sha512) with hashlib.\1 All versions of Python we support or hope to support make the hash functions available in the same way under the same name, so we may as well drop the util forwards.
author Augie Fackler <raf@durin42.com>
date Fri, 10 Jun 2016 00:12:33 -0400
parents ead25aa27a43
children 84c1a5942f1d
comparison
equal deleted inserted replaced
29340:ae92c3eee88e 29341:0d83ad967bf8
5 # This software may be used and distributed according to the terms of the 5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version. 6 # GNU General Public License version 2 or any later version.
7 7
8 from __future__ import absolute_import 8 from __future__ import absolute_import
9 9
10 import hashlib
10 import itertools 11 import itertools
11 import os 12 import os
12 import sys 13 import sys
13 import tempfile 14 import tempfile
14 15
408 409
409 When pushing a bundle20 stream, return a bundle20 stream.''' 410 When pushing a bundle20 stream, return a bundle20 stream.'''
410 411
411 if heads != ['force'] and self.capable('unbundlehash'): 412 if heads != ['force'] and self.capable('unbundlehash'):
412 heads = encodelist(['hashed', 413 heads = encodelist(['hashed',
413 util.sha1(''.join(sorted(heads))).digest()]) 414 hashlib.sha1(''.join(sorted(heads))).digest()])
414 else: 415 else:
415 heads = encodelist(heads) 416 heads = encodelist(heads)
416 417
417 if util.safehasattr(cg, 'deltaheader'): 418 if util.safehasattr(cg, 'deltaheader'):
418 # this a bundle10, do the old style call sequence 419 # this a bundle10, do the old style call sequence