comparison 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
comparison
equal deleted inserted replaced
35581:154754d1f137 35582:72b91f905065
10 import collections 10 import collections
11 import hashlib 11 import hashlib
12 import os 12 import os
13 13
14 from .i18n import _ 14 from .i18n import _
15 from .node import nullid 15 from .node import (
16 hex,
17 nullid,
18 )
16 from . import ( 19 from . import (
17 error, 20 error,
18 match as matchmod, 21 match as matchmod,
19 merge as mergemod, 22 merge as mergemod,
20 pathutil, 23 pathutil,
171 tempsignature = cache.get('tempsignature') 174 tempsignature = cache.get('tempsignature')
172 else: 175 else:
173 tempsignature = '0' 176 tempsignature = '0'
174 177
175 if signature is None or (includetemp and tempsignature is None): 178 if signature is None or (includetemp and tempsignature is None):
176 signature = hashlib.sha1(repo.vfs.tryread('sparse')).hexdigest() 179 signature = hex(hashlib.sha1(repo.vfs.tryread('sparse')).digest())
177 cache['signature'] = signature 180 cache['signature'] = signature
178 181
179 if includetemp: 182 if includetemp:
180 raw = repo.vfs.tryread('tempsparse') 183 raw = repo.vfs.tryread('tempsparse')
181 tempsignature = hashlib.sha1(raw).hexdigest() 184 tempsignature = hex(hashlib.sha1(raw).digest())
182 cache['tempsignature'] = tempsignature 185 cache['tempsignature'] = tempsignature
183 186
184 return '%s %s' % (signature, tempsignature) 187 return '%s %s' % (signature, tempsignature)
185 188
186 def writeconfig(repo, includes, excludes, profiles): 189 def writeconfig(repo, includes, excludes, profiles):