Mercurial > public > mercurial-scm > hg-stable
diff mercurial/store.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 | b4abc438a8c9 |
children | 4c15bee42e9c |
line wrap: on
line diff
--- a/mercurial/store.py Fri Dec 29 05:22:06 2017 +0530 +++ b/mercurial/store.py Fri Dec 29 05:25:27 2017 +0530 @@ -15,6 +15,7 @@ from .i18n import _ from . import ( error, + node, policy, pycompat, util, @@ -221,7 +222,7 @@ _maxshortdirslen = 8 * (_dirprefixlen + 1) - 4 def _hashencode(path, dotencode): - digest = hashlib.sha1(path).hexdigest() + digest = node.hex(hashlib.sha1(path).digest()) le = lowerencode(path[5:]).split('/') # skips prefix 'data/' or 'meta/' parts = _auxencode(le, dotencode) basename = parts[-1]