Patchwork D2159: py3: use hex(hasher.digest())

login
register
mail settings
Submitter phabricator
Date Feb. 13, 2018, 2:47 a.m.
Message ID <81309e4ac9732a26dadf40b4df596772@localhost.localdomain>
Download mbox | patch
Permalink /patch/27760/
State Not Applicable
Headers show

Comments

phabricator - Feb. 13, 2018, 2:47 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG6426878f7f0f: py3: use hex(hasher.digest()) (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2159?vs=5460&id=5582

REVISION DETAIL
  https://phab.mercurial-scm.org/D2159

AFFECTED FILES
  hgext/largefiles/lfutil.py

CHANGE DETAILS




To: indygreg, #hg-reviewers, pulkit, durin42
Cc: mercurial-devel

Patch

diff --git a/hgext/largefiles/lfutil.py b/hgext/largefiles/lfutil.py
--- a/hgext/largefiles/lfutil.py
+++ b/hgext/largefiles/lfutil.py
@@ -15,6 +15,7 @@ 
 import stat
 
 from mercurial.i18n import _
+from mercurial.node import hex
 
 from mercurial import (
     dirstate,
@@ -371,7 +372,7 @@ 
     for data in instream:
         hasher.update(data)
         outfile.write(data)
-    return hasher.hexdigest()
+    return hex(hasher.digest())
 
 def hashfile(file):
     if not os.path.exists(file):
@@ -404,7 +405,7 @@ 
     h = hashlib.sha1()
     for chunk in util.filechunkiter(fileobj):
         h.update(chunk)
-    return h.hexdigest()
+    return hex(h.digest())
 
 def httpsendfile(ui, filename):
     return httpconnection.httpsendfile(ui, filename, 'rb')