changeset 35882:9bce28609a95

mq: fix up statusentry to be both repr()-able and bytes()-able Differential Revision: https://phab.mercurial-scm.org/D1901
author Augie Fackler <augie@google.com>
date Wed, 17 Jan 2018 22:04:34 -0500
parents 7df43e0b9fc3
children 512113eb9d26
files hgext/mq.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/mq.py	Wed Jan 17 22:07:09 2018 -0500
+++ b/hgext/mq.py	Wed Jan 17 22:04:34 2018 -0500
@@ -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',