repoview: include filter name in repr for debugging
authorYuya Nishihara <yuya@tcha.org>
Tue, 05 Dec 2017 21:56:48 +0900
changeset 35249 d4ad9d695a9e
parent 35248 c752fbe228fb
child 35250 84607c8b5af8
repoview: include filter name in repr for debugging
mercurial/repoview.py
--- a/mercurial/repoview.py	Tue Dec 05 21:50:33 2017 +0900
+++ b/mercurial/repoview.py	Tue Dec 05 21:56:48 2017 +0900
@@ -15,6 +15,7 @@
 from . import (
     obsolete,
     phases,
+    pycompat,
     tags as tagsmod,
 )
 
@@ -232,6 +233,11 @@
             return self
         return self.unfiltered().filtered(name)
 
+    def __repr__(self):
+        return r'<%s:%s %r>' % (self.__class__.__name__,
+                                pycompat.sysstr(self.filtername),
+                                self.unfiltered())
+
     # everything access are forwarded to the proxied repo
     def __getattr__(self, attr):
         return getattr(self._unfilteredrepo, attr)