[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Small tool to make Tortoise auto-connect to VPN

From: Leo Davidson <leonudeldavidson_at_gmail.com>
Date: Wed, 7 Jul 2010 14:39:42 +0100

Hi everyone,

Just want to share a small thing I made for people using Tortoise SVN
(and similar tools) over VPNs (virtual private networks). (It'll also
help with RAS dial-ups, I think.)

It's just a command-line exe that checks if a VPN is connected and, if
not, tells Windows to connect to it and waits for that to finish.

If you access SVN over a VPN it can be a pain to manually connect
first (especially if the VPN disconnects due to inactivity and you're
never sure if it's still connected).

I couldn't find a good one existing solution so I wrote my own. (I
found was RasDial.exe but that prompts via the command-line and asks
for the VPN password even if you're already connected.)

After testing (on Windows 7 x64, FWIW) for a few weeks it seems to
work well. The binary and C++ source are here:

http://www.pretentiousname.com/miscsoft/index.html#ConnectVPN

To use it with Tortoise SVN, first create a .bat file that runs the
tool with the name of your VPN (the connection name in the network
control panel). Then tell Tortoise to run the .bat file as part of its
pre_commit_hook and pre_update_hook. (Set both to wait=true and
show/hide=hide.)

(A .bat file is used because AFAIK you can't specify arbitrary
command-line arguments for hooks in the Tortoise SVN.)

When you commit or update:

- If you're not on the VPN, you'll see the standard Windows VPN/RAS
connection user interface (password prompt, progress windows, etc.).
Once connected the commit/update will continue as normal.

- If you're already connected then nothing extra will happen and
you'll commit/update as normal.

Limitation:

- AFAIK, Tortoise SVN only has hooks for commit and update so there's
no way to run the tool before other events (e.g. log or blame). I've
not found that to be a big deal but it'll depend how you typically use
SVN.

It's a very simple tool but I hope other people find it useful.

Leo

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=2630515

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2010-07-07 15:42:54 CEST

This is an archived mail posted to the TortoiseSVN Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.