changeset 34494:bbb5687e5140

configitems: register the 'perf.stub' config
author Boris Feld <boris.feld@octobus.net>
date Fri, 30 Jun 2017 03:43:46 +0200
parents c4a2db2cc0fb
children 6d1b0970f80c
files contrib/perf.py
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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