Show More
@@ -359,6 +359,21 b' def canonpath(path):' | |||||
359 | return os.path.realpath(os.path.expanduser(path)) |
|
359 | return os.path.realpath(os.path.expanduser(path)) | |
360 |
|
360 | |||
361 |
|
361 | |||
|
362 | def which(exe): | |||
|
363 | if PYTHON3: | |||
|
364 | # shutil.which only accept bytes from 3.8 | |||
|
365 | cmd = _bytes2sys(exe) | |||
|
366 | real_exec = shutil.which(cmd) | |||
|
367 | return _sys2bytes(real_exec) | |||
|
368 | else: | |||
|
369 | # let us do the os work | |||
|
370 | for p in osenvironb[b'PATH'].split(os.pathsep): | |||
|
371 | f = os.path.join(p, exe) | |||
|
372 | if os.path.isfile(f): | |||
|
373 | return f | |||
|
374 | return None | |||
|
375 | ||||
|
376 | ||||
362 | def parselistfiles(files, listtype, warn=True): |
|
377 | def parselistfiles(files, listtype, warn=True): | |
363 | entries = dict() |
|
378 | entries = dict() | |
364 | for filename in files: |
|
379 | for filename in files: | |
@@ -1829,8 +1844,6 b' class TTest(Test):' | |||||
1829 |
|
1844 | |||
1830 | if self._debug: |
|
1845 | if self._debug: | |
1831 | script.append(b'set -x\n') |
|
1846 | script.append(b'set -x\n') | |
1832 | if self._hgcommand != b'hg': |
|
|||
1833 | script.append(b'alias hg="%s"\n' % self._hgcommand) |
|
|||
1834 | if os.getenv('MSYSTEM'): |
|
1847 | if os.getenv('MSYSTEM'): | |
1835 | script.append(b'alias pwd="pwd -W"\n') |
|
1848 | script.append(b'alias pwd="pwd -W"\n') | |
1836 |
|
1849 | |||
@@ -3436,6 +3449,7 b' class TestRunner(object):' | |||||
3436 | if self.options.rhg: |
|
3449 | if self.options.rhg: | |
3437 | assert self._installdir |
|
3450 | assert self._installdir | |
3438 | self._installrhg() |
|
3451 | self._installrhg() | |
|
3452 | self._use_correct_mercurial() | |||
3439 |
|
3453 | |||
3440 | log( |
|
3454 | log( | |
3441 | 'running %d tests using %d parallel processes' |
|
3455 | 'running %d tests using %d parallel processes' | |
@@ -3628,6 +3642,25 b' class TestRunner(object):' | |||||
3628 | if not self._findprogram(pyexename): |
|
3642 | if not self._findprogram(pyexename): | |
3629 | print("WARNING: Cannot find %s in search path" % pyexename) |
|
3643 | print("WARNING: Cannot find %s in search path" % pyexename) | |
3630 |
|
3644 | |||
|
3645 | def _use_correct_mercurial(self): | |||
|
3646 | target_exec = os.path.join(self._custom_bin_dir, b'hg') | |||
|
3647 | if self._hgcommand != b'hg': | |||
|
3648 | # shutil.which only accept bytes from 3.8 | |||
|
3649 | real_exec = which(self._hgcommand) | |||
|
3650 | if real_exec is None: | |||
|
3651 | raise ValueError('could not find exec path for "%s"', real_exec) | |||
|
3652 | if real_exec == target_exec: | |||
|
3653 | # do not overwrite something with itself | |||
|
3654 | return | |||
|
3655 | if WINDOWS: | |||
|
3656 | with open(target_exec, 'wb') as f: | |||
|
3657 | f.write(b'#!/bin/sh\n') | |||
|
3658 | escaped_exec = shellquote(_bytes2sys(real_exec)) | |||
|
3659 | f.write(b'%s "$@"\n' % _sys2bytes(escaped_exec)) | |||
|
3660 | else: | |||
|
3661 | os.symlink(real_exec, target_exec) | |||
|
3662 | self._createdfiles.append(target_exec) | |||
|
3663 | ||||
3631 | def _installhg(self): |
|
3664 | def _installhg(self): | |
3632 | """Install hg into the test environment. |
|
3665 | """Install hg into the test environment. | |
3633 |
|
3666 |
@@ -751,10 +751,12 b' Check output capture control.' | |||||
751 | $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6 |
|
751 | $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6 | |
752 | pushing to ssh://user@dummy/other |
|
752 | pushing to ssh://user@dummy/other | |
753 | searching for changes |
|
753 | searching for changes | |
|
754 | remote: Fail early! (no-py3 chg !) | |||
754 | remote: adding changesets |
|
755 | remote: adding changesets | |
755 | remote: adding manifests |
|
756 | remote: adding manifests | |
756 | remote: adding file changes |
|
757 | remote: adding file changes | |
757 | remote: Fail early! |
|
758 | remote: Fail early! (py3 !) | |
|
759 | remote: Fail early! (no-py3 no-chg !) | |||
758 | remote: transaction abort! |
|
760 | remote: transaction abort! | |
759 | remote: Cleaning up the mess... |
|
761 | remote: Cleaning up the mess... | |
760 | remote: rollback completed |
|
762 | remote: rollback completed |
@@ -648,14 +648,12 b' Running In Debug Mode' | |||||
648 |
|
648 | |||
649 | $ rt --debug 2>&1 | grep -v pwd |
|
649 | $ rt --debug 2>&1 | grep -v pwd | |
650 | running 2 tests using 1 parallel processes |
|
650 | running 2 tests using 1 parallel processes | |
651 | + alias hg=hg.exe (windows !) |
|
|||
652 | + echo *SALT* 0 0 (glob) |
|
651 | + echo *SALT* 0 0 (glob) | |
653 | *SALT* 0 0 (glob) |
|
652 | *SALT* 0 0 (glob) | |
654 | + echo babar |
|
653 | + echo babar | |
655 | babar |
|
654 | babar | |
656 | + echo *SALT* 10 0 (glob) |
|
655 | + echo *SALT* 10 0 (glob) | |
657 | *SALT* 10 0 (glob) |
|
656 | *SALT* 10 0 (glob) | |
658 | .+ alias hg=hg.exe (windows !) |
|
|||
659 | *+ echo *SALT* 0 0 (glob) |
|
657 | *+ echo *SALT* 0 0 (glob) | |
660 | *SALT* 0 0 (glob) |
|
658 | *SALT* 0 0 (glob) | |
661 | + echo babar |
|
659 | + echo babar |
@@ -304,8 +304,10 b' push should succeed even though it has a' | |||||
304 | remote: adding changesets |
|
304 | remote: adding changesets | |
305 | remote: adding manifests |
|
305 | remote: adding manifests | |
306 | remote: adding file changes |
|
306 | remote: adding file changes | |
307 | remote: added 1 changesets with 1 changes to 1 files |
|
307 | remote: added 1 changesets with 1 changes to 1 files (py3 !) | |
|
308 | remote: added 1 changesets with 1 changes to 1 files (no-py3 no-chg !) | |||
308 | remote: KABOOM |
|
309 | remote: KABOOM | |
|
310 | remote: added 1 changesets with 1 changes to 1 files (no-py3 chg !) | |||
309 | $ hg -R ../remote heads |
|
311 | $ hg -R ../remote heads | |
310 | changeset: 5:1383141674ec |
|
312 | changeset: 5:1383141674ec | |
311 | tag: tip |
|
313 | tag: tip | |
@@ -474,8 +476,10 b' stderr from remote commands should be pr' | |||||
474 | remote: adding changesets |
|
476 | remote: adding changesets | |
475 | remote: adding manifests |
|
477 | remote: adding manifests | |
476 | remote: adding file changes |
|
478 | remote: adding file changes | |
477 | remote: added 1 changesets with 1 changes to 1 files |
|
479 | remote: added 1 changesets with 1 changes to 1 files (py3 !) | |
|
480 | remote: added 1 changesets with 1 changes to 1 files (no-py3 no-chg !) | |||
478 | remote: KABOOM |
|
481 | remote: KABOOM | |
|
482 | remote: added 1 changesets with 1 changes to 1 files (no-py3 chg !) | |||
479 | local stdout |
|
483 | local stdout | |
480 |
|
484 | |||
481 | debug output |
|
485 | debug output |
@@ -301,9 +301,11 b' push should succeed even though it has a' | |||||
301 | remote: adding changesets |
|
301 | remote: adding changesets | |
302 | remote: adding manifests |
|
302 | remote: adding manifests | |
303 | remote: adding file changes |
|
303 | remote: adding file changes | |
304 | remote: added 1 changesets with 1 changes to 1 files |
|
304 | remote: added 1 changesets with 1 changes to 1 files (py3 !) | |
|
305 | remote: added 1 changesets with 1 changes to 1 files (no-py3 no-chg !) | |||
305 | remote: KABOOM |
|
306 | remote: KABOOM | |
306 | remote: KABOOM IN PROCESS |
|
307 | remote: KABOOM IN PROCESS | |
|
308 | remote: added 1 changesets with 1 changes to 1 files (no-py3 chg !) | |||
307 | $ hg -R ../remote heads |
|
309 | $ hg -R ../remote heads | |
308 | changeset: 5:1383141674ec |
|
310 | changeset: 5:1383141674ec | |
309 | tag: tip |
|
311 | tag: tip | |
@@ -527,9 +529,11 b' stderr from remote commands should be pr' | |||||
527 | remote: adding changesets |
|
529 | remote: adding changesets | |
528 | remote: adding manifests |
|
530 | remote: adding manifests | |
529 | remote: adding file changes |
|
531 | remote: adding file changes | |
530 | remote: added 1 changesets with 1 changes to 1 files |
|
532 | remote: added 1 changesets with 1 changes to 1 files (py3 !) | |
|
533 | remote: added 1 changesets with 1 changes to 1 files (no-py3 no-chg !) | |||
531 | remote: KABOOM |
|
534 | remote: KABOOM | |
532 | remote: KABOOM IN PROCESS |
|
535 | remote: KABOOM IN PROCESS | |
|
536 | remote: added 1 changesets with 1 changes to 1 files (no-py3 chg !) | |||
533 | local stdout |
|
537 | local stdout | |
534 |
|
538 | |||
535 | debug output |
|
539 | debug output |
@@ -35,9 +35,12 b' disconnecting. Then exit nonzero, to for' | |||||
35 | $ hg push -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" --remotecmd "$remotecmd" |
|
35 | $ hg push -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" --remotecmd "$remotecmd" | |
36 | pushing to ssh://user@dummy/$TESTTMP/remote |
|
36 | pushing to ssh://user@dummy/$TESTTMP/remote | |
37 | searching for changes |
|
37 | searching for changes | |
38 | remote: adding changesets |
|
38 | remote: adding changesets (py3 !) | |
39 | remote: adding manifests |
|
39 | remote: adding manifests (py3 !) | |
40 | remote: adding file changes |
|
40 | remote: adding file changes (py3 !) | |
|
41 | remote: adding changesets (no-py3 no-chg !) | |||
|
42 | remote: adding manifests (no-py3 no-chg !) | |||
|
43 | remote: adding file changes (no-py3 no-chg !) | |||
41 | abort: stream ended unexpectedly (got 0 bytes, expected 4) |
|
44 | abort: stream ended unexpectedly (got 0 bytes, expected 4) | |
42 | [255] |
|
45 | [255] | |
43 | $ cat $SIGPIPE_REMOTE_DEBUG_FILE |
|
46 | $ cat $SIGPIPE_REMOTE_DEBUG_FILE |
General Comments 0
You need to be logged in to leave comments.
Login now