comparison mercurial/merge.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 4d075bf28702
children 1e4512eac59e
comparison
equal deleted inserted replaced
29340:ae92c3eee88e 29341:0d83ad967bf8
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 errno 10 import errno
11 import hashlib
11 import os 12 import os
12 import shutil 13 import shutil
13 import struct 14 import struct
14 15
15 from .i18n import _ 16 from .i18n import _
406 note: also write the local version to the `.hg/merge` directory. 407 note: also write the local version to the `.hg/merge` directory.
407 """ 408 """
408 if fcl.isabsent(): 409 if fcl.isabsent():
409 hash = nullhex 410 hash = nullhex
410 else: 411 else:
411 hash = util.sha1(fcl.path()).hexdigest() 412 hash = hashlib.sha1(fcl.path()).hexdigest()
412 self._repo.vfs.write('merge/' + hash, fcl.data()) 413 self._repo.vfs.write('merge/' + hash, fcl.data())
413 self._state[fd] = ['u', hash, fcl.path(), 414 self._state[fd] = ['u', hash, fcl.path(),
414 fca.path(), hex(fca.filenode()), 415 fca.path(), hex(fca.filenode()),
415 fco.path(), hex(fco.filenode()), 416 fco.path(), hex(fco.filenode()),
416 fcl.flags()] 417 fcl.flags()]