[PATCH] run-tests: add flag to provide extra hgrc options for test runs

Augie Fackler durin42 at gmail.com
Sun May 1 09:19:43 CDT 2011


# HG changeset patch
# User Augie Fackler <durin42 at gmail.com>
# Date 1304254825 18000
# Node ID 371b28ecee95945f57f8a11b90f757ca9aac9fcc
# Parent  e83ced8b6464ff8f4c6cd9e4b780ba4b5d6208e0
run-tests: add flag to provide extra hgrc options for test runs

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -165,6 +165,8 @@
              "temporary installation")
     parser.add_option("-3", "--py3k-warnings", action="store_true",
         help="enable Py3k warnings on Python 2.6+")
+    parser.add_option('--extra-config-opt', action="append",
+                      help='set the given config opt in the test hgrc')
 
     for option, default in defaults.items():
         defaults[option] = int(os.environ.get(*default))
@@ -754,6 +756,12 @@
         hgrc.write('[inotify]\n')
         hgrc.write('pidfile=%s\n' % DAEMON_PIDS)
         hgrc.write('appendpid=True\n')
+    if options.extra_config_opt:
+        for opt in options.extra_config_opt:
+            section, key = opt.split('.', 1)
+            assert '=' in key, ('extra config opt %s must '
+                                'have an = for assignment' % opt)
+            hgrc.write('[%s]\n%s\n' % (section, key))
     hgrc.close()
 
     ref = os.path.join(TESTDIR, test+".out")


More information about the Mercurial-devel mailing list