We Recommend

Version Control with Subversion Version Control with Subversion
Written by members of the Subversion open source development team, Version Control with Subversion introduces the powerful new versioning tool designed to be the successor to the Concurrent Version System or CVS. CVS users will find the "look and feel" Subversion comfortably familiar, but under the surface it's far more flexible, robust, and usable, and more importantly, it improves on CVS's more notable flaws.


Posted By

bartbons on 03/20/07


Tagged

svn delete remove files missing


Versions (?)


Who likes this?

2 people have marked this snippet as a favorite

jarjar2k7
koncept


remove missing files with SVN


Published in: SVN 


URL: http://svn.haxx.se/users/archive-2005-07/0849.shtml

  1. svn rm $( svn status | sed -e '/^!/!d' -e 's/^!//' )

Report this snippet 

Comments

RSS Icon Subscribe to comments
Posted By: troy on January 29, 2009

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" )
)

Posted By: troy on January 29, 2009

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" )
)

Posted By: troy on January 29, 2009

A couple newline characters got lost when posting. Not sure how to fix, but you get the idea. Sorry for the repost.

Posted By: troy on January 29, 2009
@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"
  )  
)
Posted By: craiga on March 13, 2009

Doesn't work with file paths with whitespace.

You need to login to post a comment.