contrib/check-config.py
changeset 32849 e9fc5550be46
parent 32848 485b8e87e244
child 33195 5d8942dbe49e
--- a/contrib/check-config.py	Thu Jun 15 10:38:19 2017 -0700
+++ b/contrib/check-config.py	Thu Jun 15 10:58:36 2017 -0700
@@ -24,6 +24,16 @@
         (?:default=)?(?P<default>\S+?))?
     \)''', re.VERBOSE | re.MULTILINE)
 
+configwithre = re.compile('''
+    ui\.config(?P<ctype>with)\(
+        # First argument is callback function. This doesn't parse robustly
+        # if it is e.g. a function call.
+        [^,]+,\s*
+        ['"](?P<section>\S+)['"],\s*
+        ['"](?P<option>\S+)['"](,\s+
+        (?:default=)?(?P<default>\S+?))?
+    \)''', re.VERBOSE | re.MULTILINE)
+
 configpartialre = (r"""ui\.config""")
 
 def main(args):
@@ -79,7 +89,7 @@
 
             # look for code-like bits
             line = carryover + l
-            m = configre.search(line)
+            m = configre.search(line) or configwithre.search(line)
             if m:
                 ctype = m.group('ctype')
                 if not ctype: