Recently, I was upgrading a set of files in a svn working copy directory. I received the upgraded files from a third party. I used a merge tool to synchronize and merge the files, deleting files that were no longer needed. But this just deleted them from the working copy; not the svn repository. I could do a 'svn status' and "see" that files were missing, but there didn't seem to be a way for me to tell svn to delete them.

A quick Google Search pointed me to SNIPPLR.

The batch file created by troy, helped enormously!
I modified it a bit to fit my system. See below.

  1. @echo off
  2. rem :: This script deletes files from svn that are missing in the specified working copy.
  3. set SVN=<location_of_svn_executable>\bin\svn.exe
  4.  
  5. if "%1"=="" (
  6.     echo usage: %0 workingCopy
  7.     exit /b
  8. )
  9.  
  10. for /f "usebackq tokens=1*" %%a in (`%SVN% status %1`) do (
  11.     if "%%a"=="!" (
  12.         echo svn delete "%%b"
  13.         %SVN% delete "%%b"
  14.     )
  15. )

Edit: Fixed a problem with the actual svn delete command. It wasn't wrapped in %s so it was actually calling a SVN executable in my path. I recently had to replace a hard drive so when I went to run this batch file, svn wasn't in this new system's path and failed.