Skip to content

Commit

Permalink
tagging updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Iain Hecker committed Apr 7, 2009
1 parent fe64023 commit 78c05f7
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 21 deletions.
21 changes: 11 additions & 10 deletions README.textile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ h1. RakeSvn

Some handy rake tasks for subversion.

* *svn:repository* prints and sets current svn repository url
* *svn:tags* lists all tags
* *svn:tag* tag the current trunk, use VERSION=x to name it
* *svn:add* adds all new files to svn
* *svn:rm* removes all missing files from svn
* *svn:both* adds all new files and removes missing files to svn
* *svn:init_rails* sets common ignores for rails
* *svn:ignore* add an ignore, use DIR='x' and IGNORE='foo;bar' (semicolon separated)
rake svn:add # Add all new files to repository
rake svn:rm # Deletes all missing files from the repository
rake svn:both # Perfom both add and rm
rake svn:ignore # Adds an ignore. Use DIR='x' and IGNORE='foo;bar'
rake svn:init_rails # Configure Subversion for Rails
rake svn:repository # Gets the current svn repository url.
rake svn:tag # Tag current trunk.
rake svn:tag:delete # Delete a tag.
rake svn:tag:list # List all tags.
rake svn:tag:replace # Delete a tag and tag current trunk.

h2. Example

Expand All @@ -35,7 +37,6 @@ Example output of rake svn:init_rails
At revision 4.
At revision 4.
svn: 'db/*.sqlite*' does not exist
svn: 'db/schema.rb' does not exist
At revision 4.
property 'svn:ignore' set on 'db'
At revision 4.
Expand Down Expand Up @@ -89,7 +90,7 @@ Example output of rake svn:init_rails
Committed revision 10.
At revision 10.
At revision 10.
cp /home/iain/finalist/evp/vendor/plugins/rake_svn/tasks/../database-files/database.oracle.yml /home/iain/finalist/evp/vendor/plugins/rake_svn/tasks/../database-files/database.postgresql.yml /home/iain/finalist/evp/vendor/plugins/rake_svn/tasks/../database-files/database.sqlite3.yml /home/iain/finalist/evp/vendor/plugins/rake_svn/tasks/../database-files/database.sqlite2.yml /home/iain/finalist/evp/vendor/plugins/rake_svn/tasks/../database-files/database.mysql.yml config/
cp /home/iain/vendor/plugins/rake_svn/tasks/../database-files/database.oracle.yml /home/iain/vendor/plugins/rake_svn/tasks/../database-files/database.postgresql.yml /home/iain/vendor/plugins/rake_svn/tasks/../database-files/database.sqlite3.yml /home/iain/vendor/plugins/rake_svn/tasks/../database-files/database.sqlite2.yml /home/iain/vendor/plugins/rake_svn/tasks/../database-files/database.mysql.yml config/
A config/database.oracle.yml
A config/database.postgresql.yml
A config/database.sqlite3.yml
Expand Down
2 changes: 2 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ Spec::Rake::SpecTask.new(:spec) do |t|
t.spec_opts = ['--colour --format progress --loadby mtime --reverse']
t.spec_files = FileList['spec/**/*_spec.rb']
end

Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext| load ext }
39 changes: 28 additions & 11 deletions tasks/rake_svn_tasks.rake
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,33 @@ namespace :svn do
puts "Using repository #{SVN_BASE}"
end

desc "Tag current trunk. Use VERSION to provide a version number."
task :tag => :repository do
version = ENV['VERSION'] or raise 'Provide a VERSION-number, e.g. rake svn:tag VERSION=0.1.3'
trunk, tag = SVN_BASE + "trunk", SVN_BASE + "tags/#{version}"
system *(%w(svn copy -m) << "Tagged release number #{version} as a copy from trunk." << trunk << tag)
end

desc "List all tags."
task :tags => :repository do
system *(%w(svn list -v) << "#{SVN_BASE}tags")
desc "Tag current trunk. Use TAG to provide a version number."
task :tag => :"svn:tag:tag"

namespace :tag do

task :tag => :version do
trunk, tag = SVN_BASE + "trunk", SVN_BASE + "tags/#{TAG}"
system *(%w(svn copy -m) << "Tagged release number #{TAG} as a copy from trunk." << trunk << tag)
end

desc "Delete a tag. Use TAG to provide a version number."
task :delete => :version do
system "svn delete #{SVN_BASE}/tags/#{TAG}"
end

desc "Delete a tag and tag current trunk. Use TAG to provide a version number."
task :replace => [:delete_tag, :tag]

desc "List all tags."
task :list => :repository do
system *(%w(svn list -v) << "#{SVN_BASE}tags")
end

task :version => :repository do
TAG = ENV['TAG'] or raise 'Provide a TAG-number, e.g. rake svn:tag TAG=0.1.3'
end

end

desc "Add all new files to repository"
Expand All @@ -34,7 +51,7 @@ namespace :svn do
desc "Configure Subversion for Rails"
task :init_rails do
svn_ignore 'log', '*'
svn_ignore 'db', '*.sqlite*', 'schema.rb'
svn_ignore 'db', '*.sqlite*'

svn_ignore 'tmp/cache', '*'
svn_ignore 'tmp/pids', '*'
Expand Down

0 comments on commit 78c05f7

Please sign in to comment.