Skip to content

Updates to script for 2-14-maintenance #55

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 10, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,15 @@ namespace :travis do
end

each_project_with_common_travis_build do |name|
if system("git show-branch #{branch_name} > /dev/null 2> /dev/null")
puts "Branch #{branch_name} already exists, delete? [Y/n] or rename new branch? [r[ename] <name>]"
input = STDIN.gets.downcase
if input =~ /^y/
`git branch -D #{branch_name}`
elsif input =~ /^r(?:ename)? (.*)$/
branch_name = $1
end
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks pretty useful but the rename thing confused me a bit -- I assumed it was renaming the branch that was already there, rather than using a different name for the branch you are creating.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reworded.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note, this diff doesn't show that due to @github "feature", this diff is outdated it just doesn't admit it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me.

sh "git checkout -b #{branch_name}"

files.each do |file|
Expand Down
2 changes: 1 addition & 1 deletion travis/script/clone_all_rspec_repos
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if is_mri; then
clone_repo "rspec-expectations"
clone_repo "rspec-mocks"

if [ "$MAINTENANCE_BRANCH" != "2-99-maintenance" ]; then
if rspec_support_compatible; then
clone_repo "rspec-support"
fi

Expand Down
9 changes: 9 additions & 0 deletions travis/script/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ function is_mri_192 {
fi
}

function rspec_support_compatible {
if [ "$MAINTENANCE_BRANCH" != "2-99-maintenance" ] && [ "$MAINTENANCE_BRANCH" != "2-14-maintenance" ]; then
return 0
else
return 1
fi
}


function clone_repo {
if [ ! -d $1 ]; then # don't clone if the dir is already there
travis_retry git clone git://github.com/rspec/$1 --depth 1 --branch $MAINTENANCE_BRANCH
Expand Down
2 changes: 1 addition & 1 deletion travis/script/run_build
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if is_mri; then
run_spec_suite_for "rspec-expectations"
run_spec_suite_for "rspec-mocks"

if [ "$MAINTENANCE_BRANCH" != "2-99-maintenance" ]; then
if rspec_support_compatible; then
run_spec_suite_for "rspec-support"
fi
else
Expand Down