[PATCH 4 of 6] py3: use hex() to convert the hash to bytes

Pulkit Goyal 7895pulkit at gmail.com
Mon Jun 26 09:24:45 EDT 2017


# HG changeset patch
# User Pulkit Goyal <7895pulkit at gmail.com>
# Date 1498477846 -19800
#      Mon Jun 26 17:20:46 2017 +0530
# Node ID a4ababd6d202fa9575020df07bd7bde1d7575203
# Parent  ec85a665d187da18d585837150e4175ebb25e2ad
py3: use hex() to convert the hash to bytes

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -414,7 +414,7 @@
         if fcl.isabsent():
             hash = nullhex
         else:
-            hash = hashlib.sha1(fcl.path()).hexdigest()
+            hash = hex(hashlib.sha1(fcl.path()).digest())
             self._repo.vfs.write('merge/' + hash, fcl.data())
         self._state[fd] = ['u', hash, fcl.path(),
                            fca.path(), hex(fca.filenode()),


More information about the Mercurial-devel mailing list