Patchwork [05,of,14] configitems: register the 'perf.stub' config

login
register
mail settings
Submitter Boris Feld
Date Oct. 6, 2017, 9:22 a.m.
Message ID <bbb5687e5140869ef504.1507281741@FB>
Download mbox | patch
Permalink /patch/24584/
State Accepted
Headers show

Comments

Boris Feld - Oct. 6, 2017, 9:22 a.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# 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

Patch

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