changeset 31529:f42ec07db6a9

localrepo: use node.hex instead of awkward .encode('latin1') Spotted as an option by Yuya. Thanks!
author Augie Fackler <augie@google.com>
date Mon, 20 Mar 2017 22:06:57 -0400
parents 23fc9b98445f
children 935a1b1117c7
files mercurial/localrepo.py
diffstat 1 files changed, 1 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py	Tue Mar 21 03:15:18 2017 +0530
+++ b/mercurial/localrepo.py	Mon Mar 20 22:06:57 2017 -0400
@@ -1083,9 +1083,7 @@
                 hint=_("run 'hg recover' to clean up transaction"))
 
         idbase = "%.40f#%f" % (random.random(), time.time())
-        ha = hashlib.sha1(idbase).hexdigest()
-        if pycompat.ispy3:
-            ha = ha.encode('latin1')
+        ha = hex(hashlib.sha1(idbase).digest())
         txnid = 'TXN:' + ha
         self.hook('pretxnopen', throw=True, txnname=desc, txnid=txnid)