Mercurial > public > mercurial-scm > hg-stable
diff mercurial/repoview.py @ 43558: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 | 9f70512ae2cf |
children | 90de6bcdf226 |
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