context: add __repr__ methods to workingfilectx and workingctx
authorNicolas Dumazet <nicdumz.commits@gmail.com>
Sun, 07 Nov 2010 18:59:27 +0900
changeset 12947 4832717aed98
parent 12945 99f7dc8def34
child 12948 de6a28ff5ffc
context: add __repr__ methods to workingfilectx and workingctx
mercurial/context.py
--- a/mercurial/context.py	Mon Nov 08 01:55:32 2010 +0100
+++ b/mercurial/context.py	Sun Nov 07 18:59:27 2010 +0900
@@ -603,6 +603,9 @@
     def __str__(self):
         return str(self._parents[0]) + "+"
 
+    def __repr__(self):
+        return "<workingctx %s>" % str(self)
+
     def __nonzero__(self):
         return True
 
@@ -897,6 +900,9 @@
     def __str__(self):
         return "%s@%s" % (self.path(), self._changectx)
 
+    def __repr__(self):
+        return "<workingfilectx %s>" % str(self)
+
     def data(self):
         return self._repo.wread(self._path)
     def renamed(self):