Handy Subversion Rake task

Just read a post from “David”:http://david.planetargon.us at “Planet Argon”:http://planetargon.us/ showing a way to “add un-added files”:http://david.planetargon.us/articles/2006/07/28/i-love-shell-scripting in your Subversion working copy.

I have made this into a simple rake task:

namespace :svn do
  desc "Adds all files with an svn status flag of '?'"
  task(:add_new) { `svn status | awk '/\\?/ {print $2}' | xargs svn add` }

Just drop this code in a file called subversion.rake inside the tasks directory. Now you can run rake svn:add_new which will add all new files with an svn status flag of ‘?’ in your working copy.