From patchwork Fri Oct 6 09:22:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [05,of,14] configitems: register the 'perf.stub' config From: Boris Feld X-Patchwork-Id: 24584 Message-Id: To: mercurial-devel@mercurial-scm.org Date: Fri, 06 Oct 2017 11:22:21 +0200 # HG changeset patch # User Boris Feld # Date 1498787026 -7200 # Fri Jun 30 03:43:46 2017 +0200 # Node ID bbb5687e5140869ef504720317147dc229da1248 # Parent c4a2db2cc0fbe473a7649b591c55e7696638e03e # EXP-Topic config.register.perf # Available At https://bitbucket.org/octobus/mercurial-devel/ # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r bbb5687e5140 configitems: register the 'perf.stub' config diff -r c4a2db2cc0fb -r bbb5687e5140 contrib/perf.py --- a/contrib/perf.py Fri Jun 30 03:32:25 2017 +0200 +++ b/contrib/perf.py Fri Jun 30 03:43:46 2017 +0200 @@ -139,6 +139,16 @@ return func return decorator +try: + import registrar + configtable = {} + configitem = registrar.configitem(configtable) + configitem('perf', 'stub', + default=False, + ) +except (ImportError, AttributeError): + pass + def getlen(ui): if ui.configbool("perf", "stub"): return lambda x: 1