Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVN: analog of hg's addremove

We have a repository with several files (no folders). Each build time we have to download the same folder from another source (db), then commit to SVN changes - update existing, remove not existed and add new files.

So idea is to have 'copy' of db's scripts in SVN each build (that's why MSBuild is used)

Problem is that I don't know analog of hg's addremove - which automatically synchronize two folders.

does anyone know how addremove can be simulated?

like image 713
Lonli-Lokli Avatar asked May 13 '11 12:05

Lonli-Lokli


2 Answers

I personally have a little bash script to do that (being on linux):

svn status | grep "^\?" | gawk '{print $2}' | xargs -r svn add
svn status | grep "^\!" | gawk '{print $2}' | xargs -r svn remove

EDIT: Thanks to cesar, here's a simpler version:

svn status | gawk '/^\?.*/ {print $2}' | xargs -r svn add
svn status | gawk '/^\!.*/ {print $2}' | xargs -r svn remove
like image 109
Eric-Karl Avatar answered Oct 03 '22 12:10

Eric-Karl


For this sort of thing, I just use mercurial, and check in and out of svn with: https://www.mercurial-scm.org/wiki/HgSubversion ... might not be exactly what you want.

like image 34
Chris Avatar answered Oct 03 '22 13:10

Chris