Patchwork [07,of,14,RFC] memctx: add __repr__ method

login
register
mail settings
Submitter Sean Farley
Date July 9, 2013, 9:54 p.m.
Message ID <d1a3597ca37413bdf606.1373406878@laptop.local>
Download mbox | patch
Permalink /patch/1816/
State Changes Requested
Headers show

Comments

Sean Farley - July 9, 2013, 9:54 p.m.
# HG changeset patch
# User Sean Farley <sean.michael.farley@gmail.com>
# Date 1373323717 18000
#      Mon Jul 08 17:48:37 2013 -0500
# Node ID d1a3597ca37413bdf6060076f5a760822ce67036
# Parent  5c33cf436b3fa3f208166b32b2529fb2caec4f53
memctx: add __repr__ method

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -1282,10 +1282,13 @@ 
             self._extra['branch'] = 'default'
 
     def __str__(self):
         return str(self._parents[0]) + "+"
 
+    def __repr__(self):
+        return "<memctx %s>" % str(self)
+
     def __int__(self):
         return self._rev
 
     def __nonzero__(self):
         return True