# HG changeset patch # User Martin von Zweigbergk # Date 2019-11-08 19:23:22 # Node ID 85628a595c378487da2aa7256a476b3a9f758ead # Parent 7fd16ddabaa04ab9d566f1d0d65aae9c5b6362a6 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 diff --git a/mercurial/repoview.py b/mercurial/repoview.py --- a/mercurial/repoview.py +++ b/mercurial/repoview.py @@ -227,9 +227,10 @@ def wrapchangelog(unfichangelog, filtere 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