Mercurial > public > mercurial-scm > hg-stable
diff mercurial/subrepo.py @ 35582:72b91f905065
py3: use node.hex(h.digest()) instead of h.hexdigest()
hashlib.sha1.hexdigest() returns str on Python 3.
Differential Revision: https://phab.mercurial-scm.org/D1792
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Fri, 29 Dec 2017 05:25:27 +0530 |
parents | c999d246e48c |
children | 35fb3367f72d |
line wrap: on
line diff
--- a/mercurial/subrepo.py Fri Dec 29 05:22:06 2017 +0530 +++ b/mercurial/subrepo.py Fri Dec 29 05:25:27 2017 +0530 @@ -55,7 +55,7 @@ def _getstorehashcachename(remotepath): '''get a unique filename for the store hash cache of a remote repository''' - return hashlib.sha1(_expandedabspath(remotepath)).hexdigest()[0:12] + return node.hex(hashlib.sha1(_expandedabspath(remotepath)).digest())[0:12] class SubrepoAbort(error.Abort): """Exception class used to avoid handling a subrepo error more than once""" @@ -789,7 +789,7 @@ yield '# %s\n' % _expandedabspath(remotepath) vfs = self._repo.vfs for relname in filelist: - filehash = hashlib.sha1(vfs.tryread(relname)).hexdigest() + filehash = node.hex(hashlib.sha1(vfs.tryread(relname)).digest()) yield '%s = %s\n' % (relname, filehash) @propertycache