Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A many-commits wrapper for port-one.rb.
git-svn-id: https://ncisvn.nci.nih.gov/svn/psc/trunk@7027 0d517254-b314-0410-acde-c619094fa49f
- Loading branch information
Rhett Sutphin
committed
Sep 26, 2011
1 parent
5a34170
commit ce7afef
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/usr/bin/env ruby | ||
|
||
require 'rubygems' | ||
require 'highline' | ||
|
||
###### | ||
# Repeatedly invokes port-one.rb for a series of commits. | ||
# Example: | ||
# | ||
# ./port-many.rb 6700-6703 6811 | ||
# | ||
# This is equivalent to: | ||
# | ||
# ./port-one.rb 6700 | ||
# ./port-one.rb 6701 | ||
# ./port-one.rb 6702 | ||
# ./port-one.rb 6703 | ||
# ./port-one.rb 6811 | ||
|
||
HL=HighLine.new | ||
PORT_ONE = File.expand_path('../port-one.rb', __FILE__) | ||
|
||
commits = ARGV.collect { |entered| | ||
if entered =~ /-/ | ||
start, stop = entered.split('-', 2).collect(&:to_i) | ||
(start..stop).to_a | ||
else | ||
entered.to_i | ||
end | ||
}.flatten | ||
|
||
unless HL.agree("About to port #{commits.join(", ")}, one at a time. Continue?") | ||
exit(0) | ||
end | ||
|
||
until commits.empty? | ||
HL.say("#{commits.size} left") | ||
commit = commits.shift | ||
unless system("#{PORT_ONE} #{commit}") | ||
puts "#{commit} failed; #{commits.join(', ')} not attempted" | ||
exit(1) | ||
end | ||
end |