Reputation: 3784
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?
Upvotes: 14
Views: 1544
Reputation: 591
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.
Upvotes: 1
Reputation: 3190
(Improvement of @Eric-Karl's answer)
Works for:
svn status | perl -ne 'print "$1\0" if /^\?\s+([^\r\n]+)/' | xargs -0 -r -I FILE svn add 'FILE@'
svn status | perl -ne 'print "$1\0" if /^\!\s+([^\r\n]+)/' | xargs -0 -r -I FILE svn remove 'FILE@'
Upvotes: 0
Reputation: 1491
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
Upvotes: 11
Reputation: 2856
I've always used the svn_load_dirs.pl
script that comes with svn for this purpose.
Upvotes: 0