6

I have a process that modifies some files and I would like to commit them via command line tortoise SVN without having to click ok. The dialog comes up and my script is forced to wait until I click ok. Here are the arguments I am using:

TortoiseProc.exe /command:commit /path:"c:\svn\MyProject" /notempfile /logmsg:"Files Modified 2010-02-12" /closeonend:3
Earlz
  • 62,085
  • 98
  • 303
  • 499
Greg Finzer
  • 6,714
  • 21
  • 80
  • 125

2 Answers2

6

Like @bmargulies said, just use svn.exe:

cd "c:\svn\MyProject"
svn commit -m "Files Modified 2010-02-12"

You cannot hide the TortoiseProc.exe dialog on commit:

Important

Remember that TortoiseSVN is a GUI client, and this automation guide shows you how to make the TortoiseSVN dialogs appear to collect user input. If you want to write a script which requires no input, you should use the official Subversion command line client instead.

(from http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-automation.html)

If you're relying on TortoiseProc's /closeonend:3 behavior to alert you when there's an error, conflict, or merge, you'll need to switch on SVN's exit codes.
I couldn't find a list of return code values beyond "0 is success, not 0 is error" in a quick Google search, though.

Community
  • 1
  • 1
mskfisher
  • 3,291
  • 4
  • 35
  • 48
  • 1
    @NSchubhan - if you have TortoiseSVN installed, it contains svn.exe already. I think Tortoise's warning should actually say "if you ONLY want to write a script that requires no input. you should use the official Subversion command line client instead." The Tortoise-bundled SVN has been fine for all of my command-line adventures. – mskfisher Jun 10 '15 at 16:55
  • @mskfisher : Am also trying to commit to svn without having to click on "OK" button. But unfortunately, there is no 'svn.exe' under TortoiseSvn bin. Is there any other way to do this? Pls let me know. – Rahul Jun 28 '17 at 11:36
  • @Rahul see NicoMinsk's comment above, or see https://stackoverflow.com/questions/2967176/where-is-svn-exe-in-my-machine – mskfisher Jun 28 '17 at 13:25
4

I recommend using svn.exe instead of TortoiseProc.exe. It will be much easier.

bmargulies
  • 97,814
  • 39
  • 186
  • 310
  • `svn.exe` maps very trivially to the command set of Tortoise, the only real thing missing is the merging/conflict editor of Tortoise.. I mean, it's `svn commit` and `svn update` how much easier could it get? – Earlz Feb 12 '10 at 15:55
  • @bmargulies : Am also trying to commit to svn without having to click on "OK" button. But unfortunately, there is no 'svn.exe' under TortoiseSvn bin. Is there any other way to do this? Pls let me know. – Rahul Jun 28 '17 at 11:37
  • Install an ordinary svn release. – bmargulies Jun 28 '17 at 16:27