Skip to content

Instantly share code, notes, and snippets.

@burtlo
Created May 17, 2011 22:22
Show Gist options
  • Save burtlo/977553 to your computer and use it in GitHub Desktop.
Save burtlo/977553 to your computer and use it in GitHub Desktop.
Danny's file example
require "p4"
require "highline"
client_root = 'C:\Ruby'
#ask user for the CL number
puts "Input desired change to refresh up to:"
last_change = gets
#ask user which branch is being refreshed
puts "QA = 0"
puts "Milestone = 1"
puts "Please select branch for integration"
selected_branch = gets
if selected_branch == "0"
branch = "[PROJ]_Dev_to_[PROJ]_QA"
elsif selected_branch == "1"
branch = "[PROJ]_Dev_to_[PROJ]_Milestone"
else
puts "This is not a valid option."
end
#Run a command line to execute the integration. P4Integ calls the integration, the next chunk is the workspace name, then the password hash
%x[P4Integ -c WORKSPACE_NAME -p XXXXXXXXXXXXXXXXX -i #{branch} -r acceptthiers -e #{last_change}]
}
require 'rubygems'
#require "p4"
require "highline/import"
client_root = 'C:\Ruby'
last_change = ask("Update to Revision Number? (HEAD)") do |question|
question.default = "HEAD"
end
selected_branch = ask("Specify a branch for integration: [Q]A or [M]ilestone") do |question|
question.validate = /^(?:Q|M)$/
end
case selected_branch
when 'Q' then branch = "[PROJ]_Dev_to_[PROJ]_QA"
when 'M' then branch = "[PROJ]_Dev_to_[PROJ]_Milestone"
end
#Run a command line to execute the integration.
# P4Integ calls the integration, the next chunk is the workspace name, then the password hash
command = "P4Integ -c WORKSPACE_NAME -p XXXXXXXXXXXXXXXXX -i #{branch} -r acceptthiers -e #{last_change}"
say "Executing Command: #{command}"
%x[#{command}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment