Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development
SVN plugin
thomas:
--- Quote from: mandrav ---Here's my setup (quite common, I think):
My repositories are on a separate linux server, already setup and working.
In my windows machine, I 've installed TortoiseSVN and that's it. Everything Just Works(tm).
--- End quote ---
Yup, pretty normal :) Except you do need svn. Sorry, I thought it came installed with Tortoise.
--- Quote ---
This dialog has two text boxes. The first one was empty (the subversion path). The second contained the path to tortoise's plink.
--- End quote ---
This very much surprises me.
The first one should never be empty. Lacking a better alternative, the plugin tries to find svn.exe with a more or less brute-force search of the most likely locations on the first run (see SubversionPlugin::NastyFind()). If nothing is found, then "svn.exe" is used, assuming that svn is in the path. If svnbinary is ever empty, it is explicitely set to "svn.exe".
The second one, too, surprises me, as it should point to TortoiseProc.exe. The path is obtained from the registry (HKEY_LOCAL_MACHINE\SOFTWARE\TortoiseCVS\RootDir) and TortoiseProc is appended. If that fails, NastyFind() is run on TortoiseProc, too, and if that fails, then Tortoise is assumed not installed. I will have to look over that again, there must be something omitted?
What the program needs is the full pathname to svn like for example C:\subversion\svn.exe (and, if you want to use a Tortoise features like branching or the conflict editor, the full path to TortoiseProc.exe, too)
--- Quote ---
I looked around a bit and dismissed the dialog (I didn't edit anything). Btw, nice options you got there ;)
--- End quote ---
Note a few may still not be functional, but the majority should be.
--- Quote ---How should I know?
--- End quote ---
By reading the project's documentation ;)
No seriously, getting svn tunnelling to work *IS* evil, and yes, it does not run out of the box.
If possible, you will not want to use svn+ssh://, but https:// instead. I use plain svn:// at home because it needs zero setup and has zero problems. You just enter your username and password in the checkout dialog and you're fine. Your server is in a DMZ anyway, I assume, so why bother.
Alternatively, for the internet, you can use apache/WebDAV. The advantage is that it has *very* fine grained access control (well, everything that apache does, in fact), and you need no special setup on the client.
But now for wrath, and for glory, and for a red dawn. You do want to use svn+ssh://
What you have to do is this:
1. Understand how svn+ssh:// works. Using this protocol, svn does not authenticate or anything. Instead, it runs via a SSH tunnel as a local user on the server (SSH does everything).
svn pretty much expects a tunnel to be readily available when it calls for it. This means that you have to setup tunnelling so that it works autonomously. It also means that the password fields in the checkout dialog are useless.
2. Have some software installed and running to use SSH. I use putty/plink, but anything should do.
3. I assume you have been using SSH for years anyway, but nevertheless:
- generate a private/public key pair and install your public key on the server
- if you are foolhardy, use a key without password (I do that, *cough*)
- otherwise, put pageant into the autostart folder, so you have to enter your password once after startup (I am too lazy for that, but I tried, it does work).
- make a putty configuration for your server and enter your private key under SSH --> Auth
- now, for as long as pageant is running after entering your password (or always, if you have none), you should be able to double-click on your session, and a SSH window opens without prompting for a password. That works? Great, because that is what svn needs.
- Now, edit %USERPROFILE%/Application Data/Subversion/config. Uncomment [tunnel] and put in the path to plink.exe. Do make sure you use forward slashes. This is a really nasty stumbling block. Save the config file. Open up code::blocks, enjoy.
mandrav:
--- Quote ---The second one, too, surprises me, as it should point to TortoiseProc.exe.
--- End quote ---
I might remember wrongly about this (I don't have your plugin available here).
--- Quote ---If possible, you will not want to use svn+ssh://, but https:// instead. I use plain svn:// at home because it needs zero setup and has zero problems. You just enter your username and password in the checkout dialog and you're fine. Your server is in a DMZ anyway, I assume, so why bother.
--- End quote ---
Right, but I use svn+ssh mainly for one-time authentication (using pageant). I enter my passphrase once per session, opposing to once on every commit (or whatever).
--- Quote ---But now for wrath, and for glory, and for a red dawn. You do want to use svn+ssh://
--- End quote ---
Yes, I do :)
To summarize: I have to setup a tunnel manually before using your plugin.
This surprises me a bit. Couldn't you use plink or something to avoid it?
Hmm...
Thanks for the info,
Yiannis.
thomas:
This is not specific for my plugin. Try running "svn svn+ssh://somewhere checkout" from a cmd prompt. I would be surprised if you could without configuring a tunnel.
Tunnelling for svn is not very well documented anywhere (at least I did not find anything really good), so much of what I am telling you was found out via trial and error. In fact, svn+ssh is the very very worst bit of an otherwise excellent tool in my opinion.
As far as I figured, svn wants to be configured to use plink (or ssh, or whatever) in the [tunnels] section. It then calls plink, telling it what server to connect to, and expects that someone else takes care of the problem.
It then runs svnserve as a local user and takes whatever comes via the tunnel as svnserve's output.
Unluckily, plink will send back "Connect as user:", and svn does not care much about that, so it will hang for a minute and eventually time out. Setting the username and password options does not change a thing.
Funnily, the very same thing will work fine from a Linux command line. The ssh program will prompt you for username and password, and there you go. No tunnel to set up, nothing alike. It just works.
The only working solution I see for Windows is to set up a tunnel with pageant (or a non-encrypted key for the courageous).
Well... ok, another solution would be of course using your own SSH tunnel like Tortoise does.
Tortoise uses a "modified" plink program. No idea what exactly is modified, but I guess they built in an interface so Tortoise can prompt you for a password (for every single connection, unluckily). However, writing a custom plink is a little out of the scope for this plugin, I am afraid ;)
One could also think to run "plink svn" instead. That would run svn as a local process on the server. This sure would work, but it would check out your working copy into your home directory on the server rather than piping them through the SSH tunnel, not quite what we want.
rickg22:
--- Quote from: thomas ---
Rick:
No problems with Sourceforge :)
Just CVS is giving me the creeps every time I use it. Using SVN proved straighforward from the first minute, and CVS still makes me think "Darn, where is the manual, this is confusing" quite often.
It is also things like this that drive me crazy:
--- Code: ---cvs -d :pserver:someone@the.server:/cvsroot/something checkout module -d somedir
--- End code ---
--- End quote ---
O.O You mean you're using COMMANDLINE CVS? :shock:
Then what have i been promoting tortoise for? :?
Anyway, maybe this is a mistake of mine - i thought you COULDN'T upload your project to sourceforge via CVS because of config issues, and you and Mandrav couldn't keep your code in sync because of this.
Forgive my ignorance :oops:
Anonymous:
Uhhhhh...... I am stupid. Cannot believe I did not try that before...
I kept wondering how TortoisePlink differs from plink. Well, I found out.
Try this inside the svn config file (with your local file paths, of course):
--- Code: ---
[tunnels]
### Configure svn protocol tunnel schemes here. By default, only
### ...
#ssh = C:/tools/plink.exe
ssh = C:/Programme/TortoiseSVN/bin/TortoisePlink.exe
--- End code ---
Now if you run "svn svn+ssh://username@somewhere", then it will use TortoisePlink. And now it is clear what the "modifications" in TortoisePlink are, too - it has a friggin GUI with a password prompt :)
So... no tunnels needed, only need to change one line in svn config, and you get prompted once per commit (or once per session if pageant is running). You can give it a custom name, too, like svn+tortoise:// or whatever you like.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version