diff options
-rw-r--r-- | railties/CHANGELOG | 2 | ||||
-rw-r--r-- | railties/builtin/rails_info/rails/info.rb | 6 | ||||
-rw-r--r-- | railties/lib/tasks/framework.rake | 25 |
3 files changed, 22 insertions, 11 deletions
diff --git a/railties/CHANGELOG b/railties/CHANGELOG index 9ecc07813d..02d003d789 100644 --- a/railties/CHANGELOG +++ b/railties/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* 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] + * Applied Prototype $() performance patches (#4465, #4477) and updated script.aculo.us [Sam Stephenson, Thomas Fuchs] * Use --simple-prompt instead of --prompt-mode simple for console compatibility with Windows/Ruby 1.8.2 #4532 [starr@starrnhorne.com] diff --git a/railties/builtin/rails_info/rails/info.rb b/railties/builtin/rails_info/rails/info.rb index 1bd063896a..29261143e9 100644 --- a/railties/builtin/rails_info/rails/info.rb +++ b/railties/builtin/rails_info/rails/info.rb @@ -33,7 +33,11 @@ module Rails def freeze_edge_version if File.exists?(rails_vendor_root) - Dir[File.join(rails_vendor_root, 'REVISION_*')].first.scan(/_(\d+)$/).first.first rescue 'unknown' + begin + Dir[File.join(rails_vendor_root, 'REVISION_*')].first.scan(/_(\d+)$/).first.first + rescue + Dir[File.join(rails_vendor_root, 'TAG_*')].first.scan(/_(\w+)$/).first.first rescue 'unknown' + end end end 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 |