[PATCH 1 of 3] run-tests: allow --chg with --with-hg if --with-chg is set

Yuya Nishihara yuya at tcha.org
Mon Jul 18 06:42:37 EDT 2016


On Mon, 18 Jul 2016 09:08:46 +0100, Jun Wu wrote:
> # HG changeset patch
> # User Jun Wu <quark at fb.com>
> # Date 1468828673 -3600
> #      Mon Jul 18 08:57:53 2016 +0100
> # Node ID 801ec794c36bcee6db09916311c62dff96729921
> # Parent  1cc5a918b7d8acdc918809d74842fecc128c4ec4
> # Available At https://bitbucket.org/quark-zju/hg-draft
> #              hg pull https://bitbucket.org/quark-zju/hg-draft -r 801ec794c36b
> run-tests: allow --chg with --with-hg if --with-chg is set

Nice, queued 2 and 3, thanks.

> Before this patch, --chg conflicts with --with-hg. But it makes sense with
> --with-chg set. This patch changes the check.
> 
> diff --git a/tests/run-tests.py b/tests/run-tests.py
> --- a/tests/run-tests.py
> +++ b/tests/run-tests.py
> @@ -322,7 +322,7 @@ def parseargs(args, parser):
>          if not (os.path.isfile(options.with_chg) and
>                  os.access(options.with_chg, os.X_OK)):
>              parser.error('--with-chg must specify a chg executable')
> -    if options.chg and options.with_hg:
> +    if options.chg and options.with_hg and not options.with_chg:
>          # chg shares installation location with hg
>          parser.error('--chg does not work when --with-hg is specified '
>                       '(use --with-chg instead)')

This patch isn't necessary. options.chg is forcibly set to False if with_chg
is specified. Otherwise, run-tests.py would try to install chg to invalid
location.


More information about the Mercurial-devel mailing list