The following batch of script should SVN delete and commit all files marked as missing (i.e. deleted locally, but not using SVN removal):
@echo off svn status | findstr /R "^!" > missing.list for /F "tokens=2 delims= " %%A in (missing.list) do ( svn delete %%A && svn -q commit %%A --message "deleting missing files")
Missing files are displayed with svn status symbol ! , eg:
! test.txt
This script then uses findstr to filter any changes except missing files. This list of missing files is then written to the missing.list file.
Then we iterate over this file using tokens=2 delims= to remove ! from the lines in the file, leaving us (hopefully) only the file name. As soon as we have the file name, we will pass it svn delete and then svn commit . Feel free to modify the contents of the message.
Please note that I have not verified this script. In particular, I donβt know what happens if one of the files you want to commit has a space in its path or what happens if you come across a part of the path conflict. It might be better to replace svn delete and svn commit with echo svn delete and echo svn commit so you can see what this script is about to do before you release it in your repository.
source share