tags:

views:

298

answers:

2

I have a working copy that gets automatically committed into SVN overnight using a script.

I use the SVN command line to do so.

After a frustrating battle with Google, I have been unable to work out how to automatically add all unversioned files in the working copy to the repository before the commit.

Does anyone know how I might go about doing this?

Kindness and thanks in advance,

Dan

+6  A: 
svn --force --depth infinity add .
Matthew Scharley
Thanks Matthew! +1 ... if I could give you more I would ;)
Daniel Elliott
After further testing, it seems `--depth` isn't necessary, but it can't hurt either.
Matthew Scharley
the --force was what I was missing ... muchos gracias!
Daniel Elliott
Use the `--force` Daniel -cough-
Matthew Scharley
A: 

You have to call svn add in your script for each unversioned file prior to svn commit—something like this for a shell script:

for file in `svn st | grep '^\?' | awk '{ print $2; }'`; do
    svn add $file
done
igor
Eww. Using `--force` on the root of the working directory will automatically add any unversioned files underneath it.
Matthew Scharley
Thanks Matthew—another thing learned. =)
igor
While your answer is technically correct, it's very overengineered, given the alternatives :)
Matthew Scharley