From patchwork Sat Mar 3 23:23:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D2616: py3: replace __str__ to __bytes__ in hgext/journal.py From: phabricator X-Patchwork-Id: 28869 Message-Id: <46d50d39a8ec8736735a1bc72fcc4366@localhost.localdomain> To: mercurial-devel@mercurial-scm.org Date: Sat, 3 Mar 2018 23:23:39 +0000 This revision was automatically updated to reflect the committed changes. Closed by commit rHG148f64bcb6de: py3: replace __str__ to __bytes__ in hgext/journal.py (authored by pulkit, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2616?vs=6500&id=6504 REVISION DETAIL https://phab.mercurial-scm.org/D2616 AFFECTED FILES hgext/journal.py CHANGE DETAILS To: pulkit, #hg-reviewers, indygreg Cc: mercurial-devel diff --git a/hgext/journal.py b/hgext/journal.py --- a/hgext/journal.py +++ b/hgext/journal.py @@ -24,6 +24,7 @@ bookmarks, cmdutil, dispatch, + encoding, error, extensions, hg, @@ -219,15 +220,17 @@ (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]) return '\n'.join(( time, self.user, self.command, self.namespace, self.name, oldhashes, newhashes)) + __str__ = encoding.strmethod(__bytes__) + class journalstorage(object): """Storage for journal entries