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.
-
@echo off
-
rem :: This script deletes files from svn that are missing in the specified working copy.
-
set SVN=<location_of_svn_executable>\bin\svn.exe
-
-
if "%1"=="" (
-
echo usage: %0 workingCopy
-
exit /b
-
)
-
-
for /f "usebackq tokens=1*" %%a in (`%SVN% status %1`) do (
-
if "%%a"=="!" (
-
echo svn delete "%%b"
-
%SVN% delete "%%b"
-
)
-
)
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.
Comments
Leave a comment Trackback