Mercurial > public > mercurial-scm > hg-stable
diff mercurial/sparse.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 | b4955650eb57 |
children | 7a1806e0daea |
line wrap: on
line diff
--- a/mercurial/sparse.py Fri Dec 29 05:22:06 2017 +0530 +++ b/mercurial/sparse.py Fri Dec 29 05:25:27 2017 +0530 @@ -12,7 +12,10 @@ import os from .i18n import _ -from .node import nullid +from .node import ( + hex, + nullid, +) from . import ( error, match as matchmod, @@ -173,12 +176,12 @@ tempsignature = '0' if signature is None or (includetemp and tempsignature is None): - signature = hashlib.sha1(repo.vfs.tryread('sparse')).hexdigest() + signature = hex(hashlib.sha1(repo.vfs.tryread('sparse')).digest()) cache['signature'] = signature if includetemp: raw = repo.vfs.tryread('tempsparse') - tempsignature = hashlib.sha1(raw).hexdigest() + tempsignature = hex(hashlib.sha1(raw).digest()) cache['tempsignature'] = tempsignature return '%s %s' % (signature, tempsignature)