/ Published in: SVN
URL: http://svn.haxx.se/users/archive-2005-07/0849.shtml
Expand |
Embed | Plain Text
svn rm $( svn status | sed -e '/^!/!d' -e 's/^!//' )
Comments
Subscribe to comments
You need to login to post a comment.

Hello, I like the Unix script above, but at work I'm forced into a Windows environment. For others stuck in a Windows environment, I hope the following will be useful. (I'm not experienced with Windows batch scripting, but the following worked for me on Windows XP.)
@echo off :: This script deletes files from svn that are missing in the specified working copy.
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" ))
Hello, I like the Unix script above, but at work I'm forced into a Windows environment. For others stuck in a Windows environment, I hope the following will be useful. (I'm not experienced with Windows batch scripting, but the following worked for me on Windows XP.)
@echo off :: This script deletes files from svn that are missing in the specified working copy.
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" ))
A couple newline characters got lost when posting. Not sure how to fix, but you get the idea. Sorry for the repost.
Doesn't work with file paths with whitespace.
How about something convulted like this?
svn status | sed -e '/^!/!d' -e 's/^! *//' | tr '\n' '\0' | xargs --null -i -t svn rm {}
This snippet removes all missing files, including those that have spaces in their paths:
cheers dude this works a treat! proper bo