<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -13,3 +13,4 @@ Started with the code at Jay Field's blog: http://blog.jayfields.com/2006/12/rub
 * Prompt for a story number
 * Show example at prompt if there is no previously entered data
 * Refactor saved data handling
+* Added a svn:revert_all task which reverts all modified files and deletes all new files</diff>
      <filename>CHANGES</filename>
    </modified>
    <modified>
      <diff>@@ -3,6 +3,8 @@ require 'open-uri'
 require 'rexml/document'
 require 'tmpdir'
 
+require File.expand_path(File.dirname(__FILE__) + '/commit_message')
+
 desc &quot;Run before checking in&quot;
 task :pc =&gt; ['svn:add', 'svn:delete', 'svn:up', :default, 'svn:st']
 
@@ -19,18 +21,6 @@ task :ci do
   end
 end
 
-class CommitMessage &lt; Struct.new(:who, :id, :what)
-  def self.prompt
-    new retrieve_saved_data(&quot;pair&quot;, &quot;bg/pg&quot;),
-        retrieve_saved_data(&quot;feature&quot;, &quot;story 83&quot;),
-        retrieve_saved_data(&quot;message&quot;, &quot;Refactored GodClass&quot;)
-  end
-  
-  def to_s
-    &quot;#{who} - #{id} - #{what}&quot;
-  end
-end unless defined?(CommitMessage) # Protect against multiple requires.
-
 def files_to_check_in?
   %x[svn st --ignore-externals].split(&quot;\n&quot;).reject {|line| line[0,1] == &quot;X&quot;}.any?
 end</diff>
      <filename>tasks/commit.rake</filename>
    </modified>
    <modified>
      <diff>@@ -6,9 +6,9 @@ namespace :svn do
 
   desc &quot;svn up and check for conflicts&quot;
   task :up do
-    status = %x[svn up]
-    puts status
-    status.each do |line|
+    output = %x[svn up]
+    puts output
+    output.each do |line|
       raise &quot;SVN conflict detected. Please resolve conflicts before proceeding.&quot; if line[0,1] == &quot;C&quot;
     end
   end
@@ -43,4 +43,16 @@ namespace :svn do
     end
   end
   task :rm =&gt; &quot;svn:delete&quot;
+  
+  desc &quot;reverts all files in svn and deletes new files&quot;
+  task :revert_all do
+    system &quot;svn revert -R .&quot;
+    %x[svn st].split(&quot;\n&quot;).each do |line|
+      next unless line[0,1] == '?'
+      filename = line[1..-1].strip
+      puts &quot;removed #{filename}&quot;
+      File.delete(filename)
+    end
+  end
+
 end</diff>
      <filename>tasks/svn.rake</filename>
    </modified>
    <modified>
      <diff>@@ -74,4 +74,14 @@ class SvnRakeTest &lt; Test::Unit::TestCase
     assert_equal &quot;removed removed_file\nremoved removed_file2\n&quot;, output
   end
   
+  test &quot;svn:revert_all calls svn revert and then removes all new files&quot; do
+    Kernel.expects(:system).with('svn revert -R .')
+    Kernel.expects(:`).with(&quot;svn st&quot;).returns(&quot;?    some_file.rb\n?    another file.txt&quot;)
+    File.expects(:delete).with(&quot;some_file.rb&quot;)
+    File.expects(:delete).with(&quot;another file.txt&quot;)
+    capture_stdout do
+      Rake::Task[&quot;svn:revert_all&quot;].execute nil
+    end
+  end
+  
 end</diff>
      <filename>test/svn_rake_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -26,6 +26,15 @@ module Kernel
     Kernel.send :`, command
   end
   
-  alias_method :backtick_without_hook, :`
   alias_method :`, :backtick_with_hook
+  
+  def self.system(command)
+    raise &quot;need to stub: Kernel.system(#{command.inspect})&quot;
+  end
+  
+  def system_with_hook(command)
+    Kernel.send :system, command
+  end
+  
+  alias_method :system, :system_with_hook
 end</diff>
      <filename>test/test_helper.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>4ff548b94f571f52bf95038127f48c08eb231150</id>
    </parent>
  </parents>
  <author>
    <name>Paul Gross</name>
    <email>pgross@gmail.com</email>
  </author>
  <url>http://github.com/pgr0ss/rake_commit_tasks/commit/563876a414efa1ed7fa2453a5a175e5f194b2a29</url>
  <id>563876a414efa1ed7fa2453a5a175e5f194b2a29</id>
  <committed-date>2008-06-18T13:40:41-07:00</committed-date>
  <authored-date>2008-06-18T13:40:41-07:00</authored-date>
  <message>Added a svn:revert_all task which reverts all modified files and deletes all new files</message>
  <tree>99fba8f5de42dc9211e893076d57138ea0313924</tree>
  <committer>
    <name>Paul Gross</name>
    <email>pgross@gmail.com</email>
  </committer>
</commit>
