Mercurial > public > mercurial-scm > hg
comparison mercurial/merge.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 | 32d11a23c9cf |
children | bd22e90c54b3 |
comparison
equal
deleted
inserted
replaced
44059:7126d8b8e0e6 | 44060:a61287a95dc3 |
---|---|
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 | |
12 import shutil | 11 import shutil |
13 import stat | 12 import stat |
14 import struct | 13 import struct |
15 | 14 |
16 from .i18n import _ | 15 from .i18n import _ |
37 scmutil, | 36 scmutil, |
38 subrepoutil, | 37 subrepoutil, |
39 util, | 38 util, |
40 worker, | 39 worker, |
41 ) | 40 ) |
41 from .utils import hashutil | |
42 | 42 |
43 _pack = struct.pack | 43 _pack = struct.pack |
44 _unpack = struct.unpack | 44 _unpack = struct.unpack |
45 | 45 |
46 | 46 |
510 @staticmethod | 510 @staticmethod |
511 def getlocalkey(path): | 511 def getlocalkey(path): |
512 """hash the path of a local file context for storage in the .hg/merge | 512 """hash the path of a local file context for storage in the .hg/merge |
513 directory.""" | 513 directory.""" |
514 | 514 |
515 return hex(hashlib.sha1(path).digest()) | 515 return hex(hashutil.sha1(path).digest()) |
516 | 516 |
517 def add(self, fcl, fco, fca, fd): | 517 def add(self, fcl, fco, fca, fd): |
518 """add a new (potentially?) conflicting file the merge state | 518 """add a new (potentially?) conflicting file the merge state |
519 fcl: file context for local, | 519 fcl: file context for local, |
520 fco: file context for remote, | 520 fco: file context for remote, |