views:

134

answers:

2

Hi,

Is there a quick way, command line tool or whatever, that will look at a folder and work out the SVN operations required to add new files, delete old ones, update existing and then commit everything?

I'm hooking this up via nant and don't want to have to mess around doing it myself.

thanks

+2  A: 

You could build a script that parses the output of svn status (you can add --xml if you like) and deletes whatever isn't there anymore (!), adds whatever is unversioned (?) and then commits everything.

Joey
@Johannes - thanks - I'm just deleting and re-adding each time now. This is fine for what I need.
Tim Peel
deleting and re-adding has the nasty side-effect of throwing away history ... not nice for most repositories :)
Joey
I know - in this case though, I'm not bothered, I just need to track the revisions.
Tim Peel
+1  A: 

I assume the folder you want do sync automatically is a versioned folder?

If that's the case, just run

svn add -R syncedfolder

to add all new files to version control.

If you have updated existing files, svn will detect those automatically. Also, files that you have deleted will be detected by svn as 'missing' and when you commit the 'syncedfolder', those missing files will automatically get deleted in the repository.

Stefan