1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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
This commit is contained in:
David Heinemeier Hansson 2006-04-03 02:38:12 +00:00
parent 484e1c65d8
commit 802493ca6d
3 changed files with 22 additions and 11 deletions

View file

@ -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]

View file

@ -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

View file

@ -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