# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 1519955154 -19800 # Node ID d79d68bb9f7c567b24b9d01570981ec8b8774f23 # Parent 6276cbc704a6fb184116740fdd633b869968caf8 py3: replace __str__ to __bytes__ in hgext/journal.py Differential Revision: https://phab.mercurial-scm.org/D2616 diff -r 6276cbc704a6 -r d79d68bb9f7c hgext/journal.py --- 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