Patchwork D11046: run-test: clarify the error with a bad --with-hg is passed

login
register
mail settings
Submitter phabricator
Date July 10, 2021, 12:38 a.m.
Message ID <differential-rev-PHID-DREV-atcmxcb4fmwc7sivtrmc-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49362/
State Superseded
Headers show

Comments

phabricator - July 10, 2021, 12:38 a.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D11046

AFFECTED FILES
  tests/run-tests.py
  tests/test-run-tests.t

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/test-run-tests.t b/tests/test-run-tests.t
--- a/tests/test-run-tests.t
+++ b/tests/test-run-tests.t
@@ -23,7 +23,7 @@ 
 #if symlink
   $ ln -s `which true` hg
   $ "$PYTHON" $TESTDIR/run-tests.py --with-hg=./hg
-  warning: --with-hg should specify an hg script
+  warning: --with-hg should specify an hg script, not: true
   running 0 tests using 0 parallel processes 
   
   # Ran 0 tests, 0 skipped, 0 failed.
diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -740,7 +740,9 @@ 
         ):
             parser.error('--with-hg must specify an executable hg script')
         if os.path.basename(options.with_hg) not in [b'hg', b'hg.exe']:
-            sys.stderr.write('warning: --with-hg should specify an hg script\n')
+            msg = 'warning: --with-hg should specify an hg script, not: %s\n'
+            msg %= _bytes2sys(os.path.basename(options.with_hg))
+            sys.stderr.write(msg)
             sys.stderr.flush()
 
     if (options.chg or options.with_chg) and WINDOWS: