Patchwork D1901: mq: fix up statusentry to be both repr()-able and bytes()-able

login
register
mail settings
Submitter phabricator
Date Feb. 1, 2018, 8:43 p.m.
Message ID <9238d7fc92689a14b24a3ad1849fe139@localhost.localdomain>
Download mbox | patch
Permalink /patch/27141/
State Not Applicable
Headers show

Comments

phabricator - Feb. 1, 2018, 8:43 p.m.
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

Patch

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',