py3: replace __str__ to __bytes__ in hgext/journal.py
Differential Revision: https://phab.mercurial-scm.org/D2616
--- a/hgext/journal.py Wed Jan 31 22:21:33 2018 -0800
+++ b/hgext/journal.py Fri Mar 02 07:15:54 2018 +0530
@@ -24,6 +24,7 @@
bookmarks,
cmdutil,
dispatch,
+ encoding,
error,
extensions,
hg,
@@ -219,8 +220,8 @@
(timestamp, tz), user, command, namespace, name,
oldhashes, newhashes)
- def __str__(self):
- """String representation for storage"""
+ def __bytes__(self):
+ """bytes representation for storage"""
time = ' '.join(map(str, self.timestamp))
oldhashes = ','.join([node.hex(hash) for hash in self.oldhashes])
newhashes = ','.join([node.hex(hash) for hash in self.newhashes])
@@ -228,6 +229,8 @@
time, self.user, self.command, self.namespace, self.name,
oldhashes, newhashes))
+ __str__ = encoding.strmethod(__bytes__)
+
class journalstorage(object):
"""Storage for journal entries