[PATCH 09 of 14 RFC] memfilectx: add __repr__ method

Sean Farley sean.michael.farley at gmail.com
Tue Jul 9 16:54:40 CDT 2013


# HG changeset patch
# User Sean Farley <sean.michael.farley at gmail.com>
# Date 1373323732 18000
#      Mon Jul 08 17:48:52 2013 -0500
# Node ID 9201246ffda525a9c8e08b4e352a0bf1725f644c
# Parent  6165df997ead55b015d2ff132c46f8fa247d9dfc
memfilectx: add __repr__ method

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -1364,10 +1364,12 @@
 
     def __nonzero__(self):
         return True
     def __str__(self):
         return "%s@%s" % (self.path(), self._changectx)
+    def __repr__(self):
+        return "<memfilectx %s>" % str(self)
     def path(self):
         return self._path
     def data(self):
         return self._data
     def flags(self):


More information about the Mercurial-devel mailing list