configitems: register the 'perf.stub' config
authorBoris Feld <boris.feld@octobus.net>
Fri, 30 Jun 2017 03:43:46 +0200
changeset 34494 bbb5687e5140
parent 34493 c4a2db2cc0fb
child 34495 6d1b0970f80c
configitems: register the 'perf.stub' config
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