Skip to content

Commit 5457fd0

Browse files
committed
Some more refactoring
1 parent ce6d93c commit 5457fd0

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ before_install:
3333
- export DISPLAY=:99.0
3434
- ./scripts/travis/install.sh
3535
before_script:
36-
- ./scripts/travis/setup.sh
3736
- ./scripts/travis/rebase.sh
37+
- ./scripts/travis/setup.sh
3838
script:
3939
- ./scripts/travis/build.sh
4040
after_success:

scripts/travis/presubmit.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/bin/bash
22
set -e
33

4-
# If we're on the branch which name is of the form branch1-q-branch2
5-
# and all the tests pass, push this branch as branch2. Note that
6-
# branch1 would alreay have been rebased onto branch2 by this point.
4+
# If we're on the branch which name is of the form branch1-q-*
5+
# and all the tests have passed, push this branch as branch1. Note that
6+
# branch1-q-* would alreay have been rebased onto branch1 by this point.
77

88
echo '***************'
99
echo '** PRESUBMIT **'
@@ -18,11 +18,11 @@ echo Current branch is: $TRAVIS_BRANCH
1818
echo Test result is: $TRAVIS_TEST_RESULT
1919

2020
if [ "$TRAVIS_REPO_SLUG" = "markovuksanovic/angular.dart" ]; then
21-
if [ $TRAVIS_TEST_RESULT -eq 0 ] && [[ $TRAVIS_BRANCH =~ ^(.*)-q-(.*)$ ]]; then
21+
if [ $TRAVIS_TEST_RESULT -eq 0 ] && [[ $TRAVIS_BRANCH =~ ^(.*)-q-.*$ ]]; then
2222
echo "Pushing HEAD to ${BASH_REMATCH[2]}..."
23-
if git push upstream HEAD:${BASH_REMATCH[2]}; then
24-
echo "${BASH_REMATCH[1]} has been merged into ${BASH_REMATCH[2]}, deleting..."
25-
git push upstream :"${BASH_REMATCH[1]}"
23+
if git push upstream HEAD:${BASH_REMATCH[1]}; then
24+
echo "${BASH_REMATCH[0]} has been merged into ${BASH_REMATCH[1]}, deleting..."
25+
git push upstream :"${BASH_REMATCH[0]}"
2626
fi
2727
fi
2828
fi

scripts/travis/rebase.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
set -e
33

44
# If we're on the branch which has the name of the form
5-
# branch1-q-branch2 we rebase branch1 onto branch2
6-
# If we're on the presubmit branch, the dev Dart release, and all unit
7-
# tests pass, merge the presubmit branch into master and push it.
5+
# branch1-q-* we rebase branch1-q-* onto branch1.
6+
# This will leave system in detached head state. After this
7+
# tests will be run. Pushing the code into appropriate
8+
# branch is done during in "after_success" phase.
89

910
echo '***************'
1011
echo '** REBASE **'
@@ -18,9 +19,9 @@ echo Current channel is: $CHANNEL
1819
echo Current branch is: $TRAVIS_BRANCH
1920

2021
if [ "$TRAVIS_REPO_SLUG" = "markovuksanovic/angular.dart" ]; then
21-
if [[ $TRAVIS_BRANCH =~ ^(.*)-q-(.*)$ ]]; then
22+
if [[ $TRAVIS_BRANCH =~ ^(.*)-q-.*$ ]]; then
2223
FROM=${BASH_REMATCH[0]}
23-
ONTO=${BASH_REMATCH[2]}
24+
ONTO=${BASH_REMATCH[1]}
2425
git config credential.helper "store --file=.git/credentials"
2526
# travis encrypt GITHUB_TOKEN_ANGULAR_ORG=??? --repo=angular/angular.dart
2627
echo "https://${GITHUB_TOKEN_ANGULAR_ORG}:@github.com" > .git/credentials

0 commit comments

Comments
 (0)