summaryrefslogtreecommitdiffstats
path: root/tasks/rake/git_workflow.rake
diff options
context:
space:
mode:
authorMax Martin <max@puppetlabs.com>2011-03-23 14:43:29 -0700
committerMax Martin <max@puppetlabs.com>2011-03-23 14:43:29 -0700
commit4196699f5fbb90ceecbb709c8502622eaad39062 (patch)
treeadb06f307051368e9fe9a23c3338fe7511eb8adf /tasks/rake/git_workflow.rake
parent7e71840e29cb09c772668a51ada3cab1e319e50f (diff)
parent66d0b16c8a0a55dd79b1b0f0e639f107e552d9ab (diff)
downloadpuppet-4196699f5fbb90ceecbb709c8502622eaad39062.tar.gz
puppet-4196699f5fbb90ceecbb709c8502622eaad39062.tar.xz
puppet-4196699f5fbb90ceecbb709c8502622eaad39062.zip
Merge branch 'next'
* next: (34 commits) (#6820) Fix File class lookup in the file type for Ruby 1.9 (#6820) Fix nagios parser to use proper hash syntax for Ruby 1.9 (#6820) Fix Invalid multibyte character (#6820) Fix RDOC parser to work with Ruby 1.9 (#6820) Fix invalid next that should be a return (#2782) Fix constant_defined? (#6527) Fix pip tests (#6527) Fix uninstall problem and refactor (#6527) Added pip package provider. maint: Change code for finding spec_helper to work with Ruby 1.9 Fix error "invalid multibyte char (US-ASCII)" under Ruby 1.9 Fixed #6562 - Minor kick documentation fix (#6566) Replace tabs with spaces (#6566) Fix ruby 1.9 incompatible case statement Fixed #6566 Replace ftools with filetuils in rake gem task (#6555) Fix another ruby 1.9 incompatible case statement Fixed #6555 - Fixed two more when then colon issues Fixed #6555 - Ruby 1.9.x returning Invalid next (SyntaxError) Fixed #6555 - Ruby 1.9.x warning: class variable access from toplevel (#6658) Propagate ENC connection errors to the agent ...
Diffstat (limited to 'tasks/rake/git_workflow.rake')
-rw-r--r--tasks/rake/git_workflow.rake100
1 files changed, 50 insertions, 50 deletions
diff --git a/tasks/rake/git_workflow.rake b/tasks/rake/git_workflow.rake
index 1ba57c1aa..75dc8833a 100644
--- a/tasks/rake/git_workflow.rake
+++ b/tasks/rake/git_workflow.rake
@@ -5,82 +5,82 @@
def find_start(start)
# This is a case statement, as we might want to map certain
# git tags to starting points that are not currently in git.
- case start
- when nil?:
- when @next_release: return "master"
- else return start
- end
+ case start
+ when nil?;
+ when @next_release; return "master"
+ else return start
+ end
end
desc "Set up git for working with Puppet"
task :git_setup do
- # This should be changed as new versions get released
- @next_release = '0.26.x'
- @remote = {}
- default_remote = {}
- default_remote[:url] = 'git://github.com/reductivelabs/puppet'
- default_remote[:name] = 'origin'
- @remote[:name] = %x{git config puppet.defaultremote}.chomp
- @remote[:name] = @remote[:name].empty? ? default_remote[:name] : @remote[:name]
- @remote[:url] = default_remote[:url] if @remote[:name] == default_remote[:name]
- default_fetch = '+refs/heads/*:refs/remotes/puppet/*'
- @remote[:fetch] = %x{git config puppet.#{@remote[:name]}.fetch}.chomp
- @remote[:fetch] = @remote[:fetch].empty? ? default_fetch : @remote[:fetch]
+ # This should be changed as new versions get released
+ @next_release = '0.26.x'
+ @remote = {}
+ default_remote = {}
+ default_remote[:url] = 'git://github.com/reductivelabs/puppet'
+ default_remote[:name] = 'origin'
+ @remote[:name] = %x{git config puppet.defaultremote}.chomp
+ @remote[:name] = @remote[:name].empty? ? default_remote[:name] : @remote[:name]
+ @remote[:url] = default_remote[:url] if @remote[:name] == default_remote[:name]
+ default_fetch = '+refs/heads/*:refs/remotes/puppet/*'
+ @remote[:fetch] = %x{git config puppet.#{@remote[:name]}.fetch}.chomp
+ @remote[:fetch] = @remote[:fetch].empty? ? default_fetch : @remote[:fetch]
end
desc "Start work on a feature"
task :start_feature, [:feature,:remote,:branch] => :git_setup do |t, args|
- args.with_defaults(:remote => @remote[:name])
- args.with_defaults(:branch => @next_release)
- start_at = find_start(args.branch)
- branch = "feature/#{start_at}/#{args.feature}"
- sh "git checkout -b #{branch} #{start_at}" do |ok, res|
- if ! ok
- raise <<EOS
+ args.with_defaults(:remote => @remote[:name])
+ args.with_defaults(:branch => @next_release)
+ start_at = find_start(args.branch)
+ branch = "feature/#{start_at}/#{args.feature}"
+ sh "git checkout -b #{branch} #{start_at}" do |ok, res|
+ if ! ok
+ raise <<EOS
Was not able to create branch for #{args.feature} on branch #{args.branch}, starting at #{start_at}: error code was: #{res.exitstatus}
EOS
- end
- end
- sh "git config branch.#{branch}.remote #{args.remote}" do |ok, res|
- raise "Could not set remote: #{$?}" unless ok
- end
-
- sh "git config branch.#{branch}.merge refs/heads/#{branch}" do |ok, res|
- raise "Could not configure merge: #{$?}" unless ok
- end
+ end
+ end
+ sh "git config branch.#{branch}.remote #{args.remote}" do |ok, res|
+ raise "Could not set remote: #{$?}" unless ok
+ end
+
+ sh "git config branch.#{branch}.merge refs/heads/#{branch}" do |ok, res|
+ raise "Could not configure merge: #{$?}" unless ok
+ end
end
desc "Do git prep to start work on a Redmine ticket"
task :start_ticket, [:ticket, :remote, :branch] => :git_setup do |t, args|
- args.with_defaults(:remote => @remote[:name])
- args.with_defaults(:branch => @next_release)
- start_at = find_start(args.branch)
- branch = "tickets/#{start_at}/#{args.ticket}"
- sh "git checkout -b #{branch} #{start_at}" do |ok, res|
- unless ok
- raise <<EOS
+ args.with_defaults(:remote => @remote[:name])
+ args.with_defaults(:branch => @next_release)
+ start_at = find_start(args.branch)
+ branch = "tickets/#{start_at}/#{args.ticket}"
+ sh "git checkout -b #{branch} #{start_at}" do |ok, res|
+ unless ok
+ raise <<EOS
Was not able to create branch for ticket #{args.ticket} on branch #{args.branch}, starting at #{start_at}: error code was: #{$?}
Git command used was: #{command}
EOS
- end
- end
+ end
+ end
sh "git config branch.#{branch}.remote #{args.remote}" do |ok, res|
- raise "Could not set remote: #{$?}" unless ok
- end
+ raise "Could not set remote: #{$?}" unless ok
+ end
sh "git config branch.#{branch}.merge refs/heads/#{branch}" do |ok, res|
- raise "Could not configure merge: #{$?}" unless ok
- end
+ raise "Could not configure merge: #{$?}" unless ok
+ end
end
# This isn't very useful by itself, but we might enhance it later, or use it
# in a dependency for a more complex task.
desc "Push out changes"
task :push_changes, [:remote] do |t, arg|
- branch = %x{git branch | grep "^" | awk '{print $2}'}
- sh "git push #{arg.remote} #{branch}" do |ok, res|
- raise "Unable to push to #{arg.remote}" unless ok
- end
+ branch = %x{git branch | grep "^" | awk '{print $2}'}
+ sh "git push #{arg.remote} #{branch}" do |ok, res|
+ raise "Unable to push to #{arg.remote}" unless ok
+ end
end
desc "Send patch information to the puppet-dev list"