/ 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.
bartbons on 03/20/07
svn delete remove files missing
4 people have marked this snippet as a favorite
jarjar2k7
koncept
radarseven
mrtambourineman
URL: http://svn.haxx.se/users/archive-2005-07/0849.shtml
svn rm $( svn status | sed -e '/^!/!d' -e 's/^!//' )
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
This command is not working anymore on windows xp. Can anyone help me out with this?
svn status E:\balaji\checkout | sed -e '/^!/!d' -e 's/^! *//' | tr '\n' '\0' | xargs --null -i -t svn rm {}
I am using subversion 1.7.7 and I get an error
sed is not recognised as an internal or external command, operable program or batch file.
svn status E:\balaji\checkout | sed -e '/^!/!d' -e 's/^! *//' | tr '\n' '\0' | xargs --null -i -t svn rm {}