From patchwork Thu Feb 1 20:43:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D1901: mq: fix up statusentry to be both repr()-able and bytes()-able From: phabricator X-Patchwork-Id: 27141 Message-Id: <9238d7fc92689a14b24a3ad1849fe139@localhost.localdomain> To: mercurial-devel@mercurial-scm.org Date: Thu, 1 Feb 2018 20:43:14 +0000 This revision was automatically updated to reflect the committed changes. Closed by commit rHG0ba365937220: mq: fix up statusentry to be both repr()-able and bytes()-able (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1901?vs=4908&id=5071 REVISION DETAIL https://phab.mercurial-scm.org/D1901 AFFECTED FILES hgext/mq.py CHANGE DETAILS To: durin42, #hg-reviewers, pulkit, indygreg Cc: yuja, mercurial-devel diff --git a/hgext/mq.py b/hgext/mq.py --- a/hgext/mq.py +++ b/hgext/mq.py @@ -148,9 +148,13 @@ class statusentry(object): def __init__(self, node, name): self.node, self.name = node, name - def __repr__(self): + + def __bytes__(self): return hex(self.node) + ':' + self.name + __str__ = encoding.strmethod(__bytes__) + __repr__ = encoding.strmethod(__bytes__) + # The order of the headers in 'hg export' HG patches: HGHEADERS = [ # '# HG changeset patch',