changeset 8080:19229b0b292d

cvsps: make debugging easier by adding __repr__() methods.
author Greg Ward <greg-hg@gerg.ca>
date Sat, 18 Apr 2009 09:43:21 -0400
parents fb162c47000b
children 81aba9e79054
files hgext/convert/cvsps.py
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/convert/cvsps.py	Sat Apr 18 09:44:51 2009 -0400
+++ b/hgext/convert/cvsps.py	Sat Apr 18 09:43:21 2009 -0400
@@ -39,6 +39,12 @@
     def __init__(self, **entries):
         self.__dict__.update(entries)
 
+    def __repr__(self):
+        return "<%s at 0x%x: %s %s>" % (self.__class__.__name__,
+                                        id(self),
+                                        self.file,
+                                        ".".join(map(str, self.revision)))
+
 class logerror(Exception):
     pass
 
@@ -442,6 +448,11 @@
     def __init__(self, **entries):
         self.__dict__.update(entries)
 
+    def __repr__(self):
+        return "<%s at 0x%x: %s>" % (self.__class__.__name__,
+                                     id(self),
+                                     getattr(self, 'id', "(no id)"))
+
 def createchangeset(ui, log, fuzz=60, mergefrom=None, mergeto=None):
     '''Convert log into changesets.'''