From patchwork Tue Dec 5 13:40:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [3,of,3] repoview: include filter name in repr for debugging From: Yuya Nishihara X-Patchwork-Id: 25939 Message-Id: <298081d4ff9f22b3b996.1512481236@mimosa> To: mercurial-devel@mercurial-scm.org Date: Tue, 05 Dec 2017 22:40:36 +0900 # HG changeset patch # User Yuya Nishihara # Date 1512478608 -32400 # Tue Dec 05 21:56:48 2017 +0900 # Node ID 298081d4ff9f22b3b996eee3a7008973933c2908 # Parent 4c2ec6b9d65bd38a7ac9138241a42a2e60d0a605 repoview: include filter name in repr for debugging diff --git a/mercurial/repoview.py b/mercurial/repoview.py --- a/mercurial/repoview.py +++ b/mercurial/repoview.py @@ -15,6 +15,7 @@ from .node import nullrev from . import ( obsolete, phases, + pycompat, tags as tagsmod, ) @@ -232,6 +233,11 @@ class repoview(object): 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)