Reputation: 153
so far I have used Tortoise SVN to commit and update folders under version control. When I commit I check "all" in the GUI dialog so that deletions as well as additions are committed.
Now I have more and more folders under version control and I would like to have a batch file for committing and updating all of them.
So far I have experimented with the command line and found this:
svn add . --force
svn commit -m"Adding missing files"
This adds new files but does not reflect any deletions.
Could you please help me with the batch files? It would make my work a lot easier but I am really too unexperienced with SVN/batch files to do this on my own...
I use Win7x64 and Tortoise SVN 1.7.12 with the command line extension.
Thank you!
Upvotes: 1
Views: 21790
Reputation: 153
I think I figured something out using gammay's and this input:
cd "C:\Users\User\Desktop"
for /f "usebackq tokens=2*" %%i in (`svn status ^| findstr /r "^\?"`) do svn add "%%i %%j"
for /f "usebackq tokens=2*" %%i in (`svn status ^| findstr /r "^\!"`) do svn delete "%%i %%j"
svn commit -m "Commit via Batch"
And
cd "C:\Users\User\Desktop"
svn update
and repeatedly for different paths!
Thank you :)
Upvotes: 7
Reputation: 6215
Firstly, which svn command line tools do you use? You can use CollabNet for 'svn' commands.
Secondly, to delete files, you need to checkout existing files from svn, then use svn delete and then svn commit.
Your question is not clear - if this doesn't answer your question, please provide a few more details.
Edited to answer asker's requirement (in comments below): OK. What you want is a script which will find the new files in the folder and add them to SVN automatically and find deleted files in folder and delete them from SVN too. I can tell you this is a dangerous as undesired files can get added/deleted.
Still, if you want to go ahead with this script this is what the script can do:
! FileA [Missing - deleted] ? FileD [Unknown - to be added]
svn delete FileA
svn add FileD
svn commit
Upvotes: 0