Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

svn script to commit a set of deleted files

Tags:

linux

shell

svn

I've deleted many files from my local copy which were present in different sub directories of main directory. I want to remove all the locally deleted files from my SVN repository also.

If I'm checking the SVN status of my main directory using svn st main_dir then all the deleted files are showing with '!' symbol which means the corresponding files are missing. But those files are not getting removed from my SVN repository even if I commit my changes using svn ci main_dir.

Is there any way or command or script to remove all the locally deleted files of my main directory and sub directories also from my SVN repository. I think we can loop through all the files of each folder and remove the locally deleted files from SVN by checking the corresponding file SVN STATUS('!'), but I don't know how to convert my idea to a script.

Can anybody please help me to finish this task? Thanks in advance ...

Siva

like image 853
Siva Avatar asked Sep 16 '10 11:09

Siva


3 Answers

for i in $(svn st | grep \! | awk '{print $2}'); do svn delete $i; done

like image 50
Gadolin Avatar answered Oct 21 '22 07:10

Gadolin


I found xargs easier than the for loop:

svn stat | grep \\! | awk '{print $2}' | xargs svn remove
like image 32
Yaron Reinharts Avatar answered Oct 21 '22 05:10

Yaron Reinharts


for i in $(svn st | grep \! | awk '{print $2}'); do svn delete $i'@'; done

For files with @2x in them.

like image 35
Matt Hudson Avatar answered Oct 21 '22 05:10

Matt Hudson