Patchwork [09,of,14,RFC] memfilectx: add __repr__ method

login
register
mail settings
Submitter Sean Farley
Date July 9, 2013, 9:54 p.m.
Message ID <9201246ffda525a9c8e0.1373406880@laptop.local>
Download mbox | patch
Permalink /patch/1818/
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 1373323732 18000
#      Mon Jul 08 17:48:52 2013 -0500
# Node ID 9201246ffda525a9c8e08b4e352a0bf1725f644c
# Parent  6165df997ead55b015d2ff132c46f8fa247d9dfc
memfilectx: add __repr__ method

Patch

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):