cvsps: make debugging easier by adding __repr__() methods.
--- 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.'''