Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can svn "ignore" deleted files or delete them from repository?

Tags:

svn

When I try to commit my project to svn I get the following issue

svn: '/var/www/sites/blabla/425/file.png' is scheduled for addition, but is missing

This happens because some material is deleted from the project (and I cannot use svn to delete it). Is there a way to say svn to ignore such files, or just to delete it them if they are not found ?

like image 650
aneuryzm Avatar asked Jan 05 '11 16:01

aneuryzm


3 Answers

When you do a svn status, the output will show any such files which are "missing" as a line starting with an exclamation mark:

!       425/file.png

You should write a script (in your scripting language or command line shell of choice) which parses this output, looks for lines starting with an exclamation mark, extracts the filename, and which then does a svn revert <filename>. This will then undo the local change to that file, allowing you to commit without problems.

edit: since you mentioned a php script in a comment, I suppose you are familiar with PHP scripting. In that case you can make use of the PHP function svn_status.

edit2: if you want to delete the file from the repository, do a svn rm --force <filename> instead.

like image 89
Wim Coenen Avatar answered Oct 08 '22 15:10

Wim Coenen


So you svn add the file but later on deleted it manually? Try;

svn rm --force file.png

to remove it from the SVN index.

like image 27
ismail Avatar answered Oct 08 '22 14:10

ismail


Run the following command from Terminal:

svn revert $(svn st | awk 'BEGIN{FS=""} $1=="!" && $2 !~ /\.(sql|log|tmpl)$/ {print $2}')
like image 25
justinwehrman Avatar answered Oct 08 '22 15:10

justinwehrman