Error deleting file "svn"

In my project, I have a folder with resources that I don’t want to manually add or remove to the repository when I add or delete them to my working copy.

I wrote a simple bash script that checks svn stateand calls svn addfor files marked ?and svn removefor files with !. I added this bash script to my build script. The problem is that it svn removereturns an error when called with a file that no longer exists locally. This causes my build script to fail and also return an error.

Is there any way to suppress these errors? I tried --forceand --quiet. Did not help.

Example:

MacBook-Pro:proj Bill$ echo "test" > foo.bar
MacBook-Pro:proj Bill$ svn st
?       foo.bar
MacBook-Pro:proj Bill$ svn add foo.bar 
A         foo.bar
MacBook-Pro:proj Bill$ rm foo.bar 
MacBook-Pro:proj Bill$ svn st
!       foo.bar
MacBook-Pro:proj Bill$ svn rm foo.bar
D         foo.bar
svn: 'foo.bar' does not exist
+3
source share
2

( ) , svn stat :

  • , , svn rm .
  • , svn add , .

svn rm , . - , :

  • , :
    touch "$filename" ; svn rm --force "$filename".
  • , :
    svn revert "$filename".
+4

, , --keep-local ​​.

script . , (?), svn add. , (!), svn rm .

svn st "$Resources" | grep '^?' | sed 's_^?       \(.*\)$_svn add "\1"_g' | sh
svn st "$Resources" | grep '^!' | sed 's_^!       \(.*\)$_svn rm --keep-local  "\1"_g' | sh
+3

All Articles