Mercurial > hg
changeset 43510:85628a595c37
repoview: use class literal for creating filteredchangelog
The type name is constant, so we don't need to create it dynamically
using type(). As suggested by Yuya.
Differential Revision: https://phab.mercurial-scm.org/D7364
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 08 Nov 2019 11:23:22 -0800 |
parents | 7fd16ddabaa0 |
children | 8e175a3d64bd |
files | mercurial/repoview.py |
diffstat | 1 files changed, 4 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/repoview.py Thu Nov 07 14:59:11 2019 -0500 +++ b/mercurial/repoview.py Fri Nov 08 11:23:22 2019 -0800 @@ -227,9 +227,10 @@ cl = copy.copy(unfichangelog) cl.filteredrevs = filteredrevs - cl.__class__ = type( - 'filteredchangelog', (filteredchangelogmixin, cl.__class__), {} - ) + class filteredchangelog(filteredchangelogmixin, cl.__class__): + pass + + cl.__class__ = filteredchangelog return cl