开发者

Scripting Tortoise SVN

Is it possible to script tortoise svn from a batch file or a vis开发者_StackOverflow社区ual studio project? I want to be able to create a batch file that will automatically get the latest version of a file and acquire a lock for that file. Any help would be appreciated.


Apart from what @BishopRook said, if you are creating a .Net app ( from what you mentioned as a visual studio project) you can use an SVN client API like SharpSVN - http://sharpsvn.open.collab.net/

It will be very easy to program using the API and get what you want.

I cannot see how you can do a complete scripting using TortosieProc.exe as @jason.rickman mentions.

Even the page for "automating" TortoiseSVN gives the below warning:

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.

For example, for the locking that the OP wants:

:lock Locks a file or all files in a directory given in /path. The 'lock' dialog is shown so the user can enter a comment for the lock.

It shows a dialog. There is no way to directly lock it. You have to proceed from the dialog. It will be very cumbersome / impossible to script with this. That is why the command line client or library / API for various platforms is the ideal solution.


It would be much easier to just script a command-line SVN client. I'm a fan of SlikSVN because it's easy to install and gets out of your way.


Yes. The TortoiseSVN documentation describes how to use TortoiseProc.exe to execute Subversion commands through TortoiseSVN: http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-automation.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜