Mercurial > hg
comparison tests/run-tests.py @ 42816:fb84730d1c5a
run-tests: error out on `--local --with-[c]hg`
I don't see much reason to allow these combinations. You could use
--local and override only one of --with-hg or --with-chg, but I don't
see much practical use for that. It would be easy to work around
anyway by passing both --with-hg and --with-chg. By erroring out, it
makes the code a bit easier to reason about to allow the next few
patches.
Differential Revision: https://phab.mercurial-scm.org/D6759
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 23 Aug 2019 08:46:49 -0700 |
parents | 9913fffd744b |
children | 69506e1b3214 |
comparison
equal
deleted
inserted
replaced
42815:197e7326b8b8 | 42816:fb84730d1c5a |
---|---|
491 parser.error('--with-hg must specify an executable hg script') | 491 parser.error('--with-hg must specify an executable hg script') |
492 if os.path.basename(options.with_hg) not in [b'hg', b'hg.exe']: | 492 if os.path.basename(options.with_hg) not in [b'hg', b'hg.exe']: |
493 sys.stderr.write('warning: --with-hg should specify an hg script\n') | 493 sys.stderr.write('warning: --with-hg should specify an hg script\n') |
494 sys.stderr.flush() | 494 sys.stderr.flush() |
495 if options.local: | 495 if options.local: |
496 if options.with_hg or options.with_chg: | |
497 parser.error('--local cannot be used with --with-hg or --with-chg') | |
496 testdir = os.path.dirname(_bytespath(canonpath(sys.argv[0]))) | 498 testdir = os.path.dirname(_bytespath(canonpath(sys.argv[0]))) |
497 reporootdir = os.path.dirname(testdir) | 499 reporootdir = os.path.dirname(testdir) |
498 pathandattrs = [(b'hg', 'with_hg')] | 500 pathandattrs = [(b'hg', 'with_hg')] |
499 if options.chg: | 501 if options.chg: |
500 pathandattrs.append((b'contrib/chg/chg', 'with_chg')) | 502 pathandattrs.append((b'contrib/chg/chg', 'with_chg')) |