##// END OF EJS Templates
localrepo: ensure transaction id is fully bytes on py3
Augie Fackler -
r31508:590319c0 default
parent child Browse files
Show More
@@ -49,6 +49,7 b' from . import ('
49 49 peer,
50 50 phases,
51 51 pushkey,
52 pycompat,
52 53 repoview,
53 54 revset,
54 55 revsetlang,
@@ -1082,7 +1083,10 b' class localrepository(object):'
1082 1083 hint=_("run 'hg recover' to clean up transaction"))
1083 1084
1084 1085 idbase = "%.40f#%f" % (random.random(), time.time())
1085 txnid = 'TXN:' + hashlib.sha1(idbase).hexdigest()
1086 ha = hashlib.sha1(idbase).hexdigest()
1087 if pycompat.ispy3:
1088 ha = ha.encode('latin1')
1089 txnid = 'TXN:' + ha
1086 1090 self.hook('pretxnopen', throw=True, txnname=desc, txnid=txnid)
1087 1091
1088 1092 self._writejournal(desc)
General Comments 0
You need to be logged in to leave comments. Login now