[PATCH 3 of 3] run-tests: make --local set --with-chg if --chg is used

Jun Wu quark at fb.com
Mon Jul 18 04:08:48 EDT 2016


# HG changeset patch
# User Jun Wu <quark at fb.com>
# Date 1468828530 -3600
#      Mon Jul 18 08:55:30 2016 +0100
# Node ID 37e43d7a5a19cce22a0436e5f0aa16aabd0e4a61
# Parent  92ee0f4dde62d10e9964aa02c3b0176cd628c081
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r 37e43d7a5a19
run-tests: make --local set --with-chg if --chg is used

--local should work with chg as well.

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -214,7 +214,8 @@ def getparser():
     parser.add_option("-k", "--keywords",
         help="run tests matching keywords")
     parser.add_option("-l", "--local", action="store_true",
-        help="shortcut for --with-hg=<testdir>/../hg")
+        help="shortcut for --with-hg=<testdir>/../hg, "
+             "and --with-chg=<testdir>/../contrib/chg/chg if --chg is set")
     parser.add_option("--loop", action="store_true",
         help="loop tests repeatedly")
     parser.add_option("--runs-per-test", type="int", dest="runs_per_test",
@@ -310,6 +311,8 @@ def parseargs(args, parser):
         testdir = os.path.dirname(_bytespath(canonpath(sys.argv[0])))
         reporootdir = os.path.dirname(testdir)
         pathandattrs = [(b'hg', 'with_hg')]
+        if options.chg:
+            pathandattrs.append((b'contrib/chg/chg', 'with_chg'))
         for relpath, attr in pathandattrs:
             binpath = os.path.join(reporootdir, relpath)
             if os.name != 'nt' and not os.access(binpath, os.X_OK):


More information about the Mercurial-devel mailing list