From 802493ca6d73c5e4fed5a0a47c181dd28d0c475d Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 3 Apr 2006 02:38:12 +0000 Subject: Added TAG option for rake rails:freeze:edge, so you can say rake rails:freeze:edge TAG=rel_1-1-0 to lock to the 1.1.0 release [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4133 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- railties/lib/tasks/framework.rake | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'railties/lib/tasks/framework.rake') diff --git a/railties/lib/tasks/framework.rake b/railties/lib/tasks/framework.rake index ff2bd78edb..097253b810 100644 --- a/railties/lib/tasks/framework.rake +++ b/railties/lib/tasks/framework.rake @@ -32,7 +32,7 @@ namespace :rails do end end - desc "Lock this application to latest Edge Rails. Lock a specific revision with REVISION=X" + desc "Lock to latest Edge Rails or a specific revision with REVISION=X (ex: REVISION=4021) or a tag with TAG=Y (ex: TAG=rel_1-1-0)" task :edge do $verbose = false `svn --version` rescue nil @@ -41,20 +41,25 @@ namespace :rails do exit 1 end - rails_svn = 'http://dev.rubyonrails.org/svn/rails/trunk' - - if ENV['REVISION'].nil? - ENV['REVISION'] = /^r(\d+)/.match(%x{svn log -q --limit 1 #{rails_svn}})[1] - puts "REVISION not set. Using HEAD, which is revision #{ENV['REVISION']}." - end - rm_rf "vendor/rails" mkdir_p "vendor/rails" - touch "vendor/rails/REVISION_#{ENV['REVISION']}" + if ENV['TAG'] + rails_svn = "http://dev.rubyonrails.org/svn/rails/tags/#{ENV['TAG']}" + touch "vendor/rails/TAG_#{ENV['TAG']}" + else + rails_svn = 'http://dev.rubyonrails.org/svn/rails/trunk' + + if ENV['REVISION'].nil? + ENV['REVISION'] = /^r(\d+)/.match(%x{svn log -q --limit 1 #{rails_svn}})[1] + puts "REVISION not set. Using HEAD, which is revision #{ENV['REVISION']}." + end + + touch "vendor/rails/REVISION_#{ENV['REVISION']}" + end for framework in %w( railties actionpack activerecord actionmailer activesupport actionwebservice ) - system "svn export #{rails_svn}/#{framework} vendor/rails/#{framework} -r #{ENV['REVISION']}" + system "svn export #{rails_svn}/#{framework} vendor/rails/#{framework}" + (ENV['REVISION'] ? " -r #{ENV['REVISION']}" : "") end end end -- cgit v1.2.3