Author Topic: SVN plugin  (Read 81341 times)

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Bounty: CVS plugin
« Reply #30 on: July 19, 2005, 11:06:58 pm »
i'm just wondering if it wouldn't be easier to fix the CVS problems between thomas and sourceforge...

Offline kagerato

  • Multiple posting newcomer
  • *
  • Posts: 56
    • kagerato.net
Bounty: CVS plugin
« Reply #31 on: July 20, 2005, 04:53:06 am »
Quote from: rickg22
i'm just wondering if it wouldn't be easier to fix the CVS problems between thomas and sourceforge...


There are problems?  I thought he just massively prefers SVN.

Anyway, let him develop what he feels is the best solution.  At some point, SVN is very likely to become equally popular as CVS; by then, all the little phantom issues and conflicts between the versioning systems will have dissipated.

As of this moment, I've not heard about any serious bugs or detrimental factors in the SVN implementation.  It seems many people are hailing it as all-around superior to CVS.  The only reasons for not adopting it now seem to be: a.) familiarity with the existing system (and resultingly, a reluctance to learn new methods), and b.) a high degree of prudence and skepticism about new technology (the "let's wait and see" approach).

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Bounty: CVS plugin
« Reply #32 on: July 20, 2005, 08:56:41 am »
Quote
The only reasons for not adopting it now seem to be: a.) familiarity with the existing system (and resultingly, a reluctance to learn new methods), and b.) a high degree of prudence and skepticism about new technology (the "let's wait and see" approach).

Let me add the more important reason, I think:
The majority of open-source projects are hosted on sf.net and sf does not support svn yet.

Yiannis.
Be patient!
This bug will be fixed soon...

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Bounty: CVS plugin
« Reply #33 on: July 20, 2005, 10:35:57 am »
Quote from: mandrav
I downloaded the sources and noticed a few things.
First, you 're using the VERSION_1_0 branch of C::B. It's not bad, just something that should be mentioned.
I compiled it using wx2.6.1 and many things (mainly event handlers) were wrong.
I 've corrected all the errors and will upload a patch for you at berlios.

Thank you :)
Now lets see if I get through the wxCompile hell alive :)

Quote
Tough luck. Either berlios doesn't have a patch tracker or you haven't enabled it...

The latter. My bad, sorry. Did enable now and uploaded your patch.

Quote from: mandrav
svn: Commit failed (details follow):
svn: Can't create tunnel: The system cannot find the file specified.

Ah, tunnelling is about the only thing that can make you really hate svn. Took me hours to get it running the first time, and the amount of helpful documentation on the internet is near zero.
I do assume that you have a tunnel running to start with, i.e. you can open a functional ssh window to the server (for example using pageant/putty).
The likely reason for this error message is that you used a native file path to your plink executable inside {CommonFiles}\subversion\config, like it is the obvious way to do. Unluckily, the obvious way does not work. You must use all forward slashes like this:
Code: [Select]
[tunnels]
ssh = $SVN_SSH  C:/tools/plink.exe



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: [Select]
cvs -d :pserver:someone@the.server:/cvsroot/something checkout module -d somedir
There are two "-d" switches in the same command line, they mean entirely different things. And worse, the order of parameters can matter, too. I don't recall an example for that now, but I had a case. Those are things that turn me off. No offense taken if someone uses CVS, but it is just not a thing for everyone.
Another thing that gets me each time is the naming scheme for repositories (I forget to type one of the many colons, mostly the third one, about 50% of the time). Sure enough, CVS existed long before most everybody had heard the word 'URL', so that somehow excuses. But then what is the deal, after one decade, in letting people write "cvs checkout pserver://someone@the.server/cvsroot/something/module -d somedir" instead.
Certainly, TortoiseCVS makes it somewhat less painful, but I still feel uncomfortable with it.
Do not grieve, Sourceforge will soon offer SVN, they announced months ago :)
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Bounty: CVS plugin
« Reply #34 on: July 20, 2005, 10:53:22 am »
Quote from: thomas
Quote from: mandrav
svn: Commit failed (details follow):
svn: Can't create tunnel: The system cannot find the file specified.

Ah, tunnelling is about the only thing that can make you really hate svn. Took me hours to get it running the first time, and the amount of helpful documentation on the internet is near zero.
I do assume that you have a tunnel running to start with, i.e. you can open a functional ssh window to the server (for example using pageant/putty).
The likely reason for this error message is that you used a native file path to your plink executable inside {CommonFiles}\subversion\config, like it is the obvious way to do. Unluckily, the obvious way does not work. You must use all forward slashes like this:
Code: [Select]
[tunnels]
ssh = $SVN_SSH  C:/tools/plink.exe

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).

I downloaded and built your plugin. Upon first C::B launch with your plugin, I went to "Settings->Configure plugins->Subversion".
This dialog has two text boxes. The first one was empty (the subversion path). The second contained the path to tortoise's plink.
I looked around a bit and dismissed the dialog (I didn't edit anything). Btw, nice options you got there ;)

Opened a project (under svn control) and right-clicked on the project root. I clicked on "Subversion->Commit (14 files changed)" and I got some assertions.
Note: It would be better to display a friendly error dialog, explaining what to do :)
Anyway, I realized that I had to install subversion for this to work.
Downloaded subversion, installed it and set the path to svn.exe in your plugin's configuration.

I then retried the same procedure as above, to commit the changes of my project.
That's when this error came up:
Code: [Select]
svn: Commit failed (details follow):
svn: Can't create tunnel: The system cannot find the file specified.


[EDIT]I can't find {CommonFiles}\subversion\config. Where is it hidden? [/EDIT]
[EDIT 2]Found it: It's in %USERPROFILE%/Application Data/Subversion/config[/EDIT 2]

As you can see I haven't touched {CommonFiles}\subversion\config. Should I?
How should I know?
I mean, I use TortoiseSVN and never had to tamper with anything of this sort.
Don't get me wrong. I appreciate all the hard work you 're doing. I just put myself in the average joe's shoes and see if she could make anything out of it.

Conclusion: a little bit more polish and a helpful README with the common pitfalls and you 're set :)

Yiannis.
Be patient!
This bug will be fixed soon...

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Bounty: CVS plugin
« Reply #35 on: July 20, 2005, 12:27:45 pm »
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).

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.

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 ;)

Note a few may still not be functional, but the majority should be.

Quote
How should I know?

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.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Bounty: CVS plugin
« Reply #36 on: July 20, 2005, 01:07:22 pm »
Quote
The second one, too, surprises me, as it should point to TortoiseProc.exe.

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.

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://

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.
Be patient!
This bug will be fixed soon...

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Bounty: CVS plugin
« Reply #37 on: July 20, 2005, 03:10:36 pm »
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.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Bounty: CVS plugin
« Reply #38 on: July 20, 2005, 03:46:17 pm »
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: [Select]
cvs -d :pserver:someone@the.server:/cvsroot/something checkout module -d somedir


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

  • Guest
Bounty: CVS plugin
« Reply #39 on: July 20, 2005, 04:06:32 pm »
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: [Select]

[tunnels]
### Configure svn protocol tunnel schemes here.  By default, only
### ...
#ssh =  C:/tools/plink.exe
ssh = C:/Programme/TortoiseSVN/bin/TortoisePlink.exe


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.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: Bounty: CVS plugin
« Reply #40 on: July 31, 2005, 11:59:22 am »
Thomas,

I checked out your latest sources and built the svn plugin.
Man, this ROCKS!!!  :lol: 8) :mrgreen:
Worked like a charm :D

To recap:
1) Build and install the plugin
2) TortoiseSVN and Subversion should be already installed
3) Edit %USERPROFILE%/Application Data/Subversion/config:
        Uncomment [tunnel]
        Add under [tunnel]: ssh = C:/Program Files/TortoiseSVN/bin/TortoisePlink.exe
4) Launch C::B and right-click an open project :D

Although I haven't tested it excessively, just normal usage, I haven't found any problems (crashes) with it. Do you think it could be included in the RC1 update that 'll be released soon?
Also, do you mind explaining the svn-properties thing? It seems very interesting but I know nil about it  :oops:
A link would be fine :lol:

Yiannis.
Be patient!
This bug will be fixed soon...

Offline Urxae

  • Regular
  • ***
  • Posts: 376
Re: Bounty: CVS plugin
« Reply #41 on: July 31, 2005, 12:35:10 pm »
Also, do you mind explaining the svn-properties thing? It seems very interesting but I know nil about it  :oops:
A link would be fine :lol:
I found this to be a very good explanation. I've never used them myself, but it looks like you can do some nifty stuff with it.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: Bounty: CVS plugin
« Reply #42 on: July 31, 2005, 01:34:19 pm »
Thanks for the link Urxae :)

Yiannis.
Be patient!
This bug will be fixed soon...

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Bounty: CVS plugin
« Reply #43 on: August 01, 2005, 03:30:57 pm »
Ah sorry, was away for the weekend. The svnbook pointed to by Urxae is a great reference. If there is anything to know about svn, its in there :)
Only thing I found that is not in there is the lock command, but that one is quite new, most servers don't support it yet, and locking is evil, anyway.

Properties in 3 sentences:
1. any kind of data (copyright message, a text explaining what a file is good for, an image thumbnail, anything) you wish to attach to one or more files or directories
2. special metadata which controls per-file keyword substitution (CVS can only do that globally, or not at all), executable flag, line end convention, mime-type, or ignore list
3. all of this data is revision controlled, which is pretty darn cool

The plugin tries to make property handling as little pain as possible. Binary-type or set-type properties are displayed inside the menu (with checkmark if active) and can be toggled by one click.
To promote the use of general keywords (like copyright info), the import dialog allows to set some properties right away.

Please do note that some of the automatic gimmicks (like the above prop-setting in the Import dialog, or auto-reload after checkout) do not all work. The way of program invokation and return value passing has been changed substantially since the last release. This requires a lot of previously working code to be rewritten yet.
The good side is, however, that overall behaviour is a lot friendlier now (non-blocking).
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: SVN plugin
« Reply #44 on: August 05, 2005, 06:45:56 pm »
Released 0.4.1 (both source and binary) today:
http://developer.berlios.de/projects/cb-svn

This release is an awful lot better than the ones before. A few things have been reimplemented, moved, or renamed and the overall behaviour has been substantially improved since the 0.3 releases (work on while a transaction is running).

The plugin will now allow diff/merge either via Tortoise, KDiff3, WinMerge, or tkdiff. The good news is KDiff3 and tkdiff are available almost everywhere. Detection is automatic.

Also, the 0.4 release can generate patch files from the project manager menu.
The resolved command is now supported, too.
Subversion 1.2 locking is supported (if your server and your client support it!).
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."