minor #18775 Fix computation of PR diffs for component matrix lines (nicolas-grekas)

This PR was merged into the 2.3 branch.

Discussion
----------

Fix computation of PR diffs for component matrix lines

| Q             | A
| ------------- | ---
| Branch?       | 2.3
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Validated on https://travis-ci.org/symfony/symfony/jobs/130061271 who fails otherwise.

Commits
-------

e7a3ae7 Fix computation of PR diffs for component matrix lines
This commit is contained in:
Fabien Potencier 2016-05-13 13:00:07 -05:00
commit 76223b2dd6
2 changed files with 3 additions and 4 deletions

View File

@ -1,20 +1,19 @@
<?php
if (4 > $_SERVER['argc']) {
echo "Usage: commit-range branch dir1 dir2 ... dirN\n";
echo "Usage: branch dir1 dir2 ... dirN\n";
exit(1);
}
$dirs = $_SERVER['argv'];
array_shift($dirs);
$range = array_shift($dirs);
$branch = array_shift($dirs);
$packages = array();
$flags = PHP_VERSION_ID >= 50400 ? JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE : 0;
foreach ($dirs as $dir) {
if (!`git diff --name-only $range -- $dir`) {
if (!`git diff --name-only $branch...HEAD -- $dir`) {
continue;
}
echo "$dir\n";

View File

@ -58,7 +58,7 @@ before_install:
install:
- if [[ ! $skip ]]; then COMPONENTS=$(find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist -printf '%h\n'); fi
# Create local composer packages for each patched components and reference them in composer.json files when cross-testing components
- if [[ ! $skip && $deps ]]; then php .travis.php $TRAVIS_COMMIT_RANGE $TRAVIS_BRANCH $COMPONENTS; fi
- if [[ ! $skip && $deps ]]; then php .travis.php $TRAVIS_BRANCH $COMPONENTS; fi
# For the master branch when deps=high, the version before master is checked out and tested with the locally patched components
- if [[ $deps = high && $TRAVIS_BRANCH = master ]]; then SYMFONY_VERSION=$(git ls-remote --heads | grep -o '/[1-9].*' | tail -n 1 | sed s/.//); else SYMFONY_VERSION=$(cat composer.json | grep '^ *"dev-master". *"[1-9]' | grep -o '[0-9.]*'); fi
- if [[ $deps = high && $TRAVIS_BRANCH = master ]]; then git fetch origin $SYMFONY_VERSION; git checkout -m FETCH_HEAD; COMPONENTS=$(find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist -printf '%h\n'); ./phpunit install; fi