I have this snippet I found.
svn status | grep '\!' | awk '{print $2;}' | xargs svn rm
It removes all missing files, if I or someone deletes the files manually (via the editor or they are deleted via the system)
But my bash coding is not great, what it's missing is that it does not work with files that have spaces in it.
svn rm Super\ Test.file
Is the correct way to remove files with a space, but I don't know how to modify the snippet above so it works. (or if you have another snippet that does)
Use TortoiseSVN → Delete to remove files or folders from Subversion. When you TortoiseSVN → Delete a file or folder, it is removed from your working copy immediately as well as being marked for deletion in the repository on next commit. The item's parent folder shows a “modified” icon overlay.
svn delete (del, remove, rm) — Delete an item from a working copy or the repository.
svn status | grep '^\!' | cut -c8- | while read f; do svn rm "$f"; done
You could 0 escape and use the -0 flag to xargs.
svn st | awk '/^!/ { sub("^! +", ""); printf "%s\0", $0 }' | xargs -0 svn rm
This has another advantage in that files with quotes or other special characters will not screw up the xargs command line either.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With