##// END OF EJS Templates
py3: use hex(hasher.digest())...
Gregory Szorc -
r36129:6426878f default
parent child Browse files
Show More
@@ -15,6 +15,7 b' import os'
15 import stat
15 import stat
16
16
17 from mercurial.i18n import _
17 from mercurial.i18n import _
18 from mercurial.node import hex
18
19
19 from mercurial import (
20 from mercurial import (
20 dirstate,
21 dirstate,
@@ -371,7 +372,7 b' def copyandhash(instream, outfile):'
371 for data in instream:
372 for data in instream:
372 hasher.update(data)
373 hasher.update(data)
373 outfile.write(data)
374 outfile.write(data)
374 return hasher.hexdigest()
375 return hex(hasher.digest())
375
376
376 def hashfile(file):
377 def hashfile(file):
377 if not os.path.exists(file):
378 if not os.path.exists(file):
@@ -404,7 +405,7 b' def hexsha1(fileobj):'
404 h = hashlib.sha1()
405 h = hashlib.sha1()
405 for chunk in util.filechunkiter(fileobj):
406 for chunk in util.filechunkiter(fileobj):
406 h.update(chunk)
407 h.update(chunk)
407 return h.hexdigest()
408 return hex(h.digest())
408
409
409 def httpsendfile(ui, filename):
410 def httpsendfile(ui, filename):
410 return httpconnection.httpsendfile(ui, filename, 'rb')
411 return httpconnection.httpsendfile(ui, filename, 'rb')
General Comments 0
You need to be logged in to leave comments. Login now