Author Topic: SVN plugin  (Read 104766 times)

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Bounty: CVS plugin
« Reply #15 on: June 23, 2005, 03:21:03 pm »
Thomas,

Let me start with many thanks for your hard work. From what you 're saying, I 'm expecting to see the most complete IDE-integrated cvs/svn solution (across all IDEs) :D .

Quote
Another thing: I have not found anything like ProjectIsClean() in c::b. Is there anything like this except walking through all buildtargets? There is cbProject::GetModified(), but that only barks when files have been added or deleted, not when they're modified and saved.

You 're right, there isn't such a function. Let's think about it.
If we had a IsClean() method in cbProject, it could tell us if the project or any of its files were modified. Easy. But knowing if it needs building or not? Hard. The compiler is a plugin and it might not even be available.
What could be done is add a CompilerPlugin::IsBuildUpToDate() method. Combined with cbProject::IsClean() you could get all the info you need.
What do you think?

On another note, you haven't mentioned if you 're planning to open the source to your plugin. If it is so, I think it would be better if it was added in third-party plugins (in CVS). More eyes on it, more testers, more work done and all these in less time.
Your thoughts?

Keep up the good work,
Yiannis.
Be patient!
This bug will be fixed soon...

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Bounty: CVS plugin
« Reply #16 on: June 23, 2005, 05:37:32 pm »
Quote from: thomas
This is arguably wrong, but in my opinion, if something is not explicitely caught by an ignore pattern, then it either should be controlled or it should not be in the project directory.


I happen to have files in my project directories which MUST NOT be uploaded to CVS. Like configurations, etc. So adding files by default is a BAD idea. After all, people can choose to add the files manually, don't they?

Just because we can sometimes forget to add a couple of times (Right chief?  :lol: ) doesn't mean it should be done.

But adding files to CVS when adding them to a *project* (not necessarily the directory), I approve, as long as you're asked first. "Do you want to add this file to cvs too?".

My 2 cents :)

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Bounty: CVS plugin
« Reply #17 on: June 24, 2005, 01:11:25 am »
Quote from: mandrav
I 'm expecting to see the most complete IDE-integrated cvs/svn solution (across all IDEs) :D .

Ah, but I haven't even spent a minute thinking about CVS yet. I hope, however, it will be not too bad to implement once SVN is done.
Only other integrated solution I know is in Dev-CPP, and that one does not do much really, does it.
BTW, sourceforge announced that they will soon offer SVN access. Maybe you can be convinced to migrate then, SVN is really an awful lot better  ;)

Quote
CompilerPlugin::IsBuildUpToDate()

Sounds great but might be quite hard work for you to get right (I guess).
What about saving the date/time of a successful build? When build returns no error, keep that date cached (or maybe just the last of these). Whenever a file is modified, it obviously gets a new modification time. One could either compare these, or cache the last time any project file was modified as well. If time_any_file_modified > time_last_successful_build then project is not clean. It is late and i am nearly sleeping, but is that correct? I think so.

Quote
On another note, you haven't mentioned if you 're planning to open the source to your plugin.

I did not think about this at all. It seemed so obvious that a plugin to an open-source IDE must be open source, too. Otherwise, it would be quite absurd...
As soon as the plugin is in a state which I need no longer be ashamed of (i.e. usable without producing an error every few minutes), I will certainly make it open source. I've made a Berlios account the other day to host it (they provide both CVS and SVN), but having it in the main repo will be ok as well, no objections to that.

Quote
I happen to have files in my project directories which MUST NOT be uploaded to CVS. Like configurations, etc. So adding files by default is a BAD idea. After all, people can choose to add the files manually, don't the

Rick, like I said, you do not need to use that feature. If you prefer doing things manually, you can do so. Different people have different needs. You  do not need to click on the checkbox that says "auto" ;)
By the way, svn has a wonderful thing called properties. Among the many things you can do with these, you can define which files, file patterns, and paths are to be ignored (by setting the svn:ignore property). It works pretty much like .cvsignore except that it is 10,000 times cooler.
So if your config files must not be uploaded, then have their pattern ignored, so you can still blindly add everything and you never need to think about it.
"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: 4315
    • Code::Blocks IDE
Bounty: CVS plugin
« Reply #18 on: June 24, 2005, 08:50:42 am »
Quote
BTW, sourceforge announced that they will soon offer SVN access. Maybe you can be convinced to migrate then, SVN is really an awful lot better

Heh, me convinced? I love svn. I started C::B over at tigris.org because they offered svn access, but for low bandwidth reasons I moved it to sourceforge.

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

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Bounty: CVS plugin
« Reply #19 on: June 24, 2005, 11:36:09 am »
Quote from: mandrav
Heh, me convinced? I love svn.


Maybe you love this, then:
http://developer.berlios.de/docman/display_doc.php?docid=28&group_id=2

Looks pretty much like sourceforge (they seem to even use the same web interface) but offers svn and a few other nifty things :)
"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 #20 on: June 24, 2005, 05:17:32 pm »
(Just don't abandon SF! :( )

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Bounty: CVS plugin
« Reply #21 on: July 06, 2005, 06:02:07 pm »
Though I hate publishing badly unfinished stuff, there was no more way around version control (broke it beyond repair once, that's enough). So well, there it is hosted at BerliOS now.

There is a "no-release" binary at the project's page:
http://developer.berlios.de/projects/cb-svn/

Common things like import, checkout, commit, update, add, and delete do work, though, so I thought maybe someone is brave enough to use it already. For those common things, it should work ok.
The binary is a verbatim copy of the one that I used to import the project to BerliOS and to check out my working copy, so I guess at least that functionality can be taken for granted.
Installation should be obvious, but there is some documentation on the site as well, including svn+ssh:// setup.

The souce code should be available via
Code
svn checkout svn://svn.berlios.de/cb-svn/trunk

However, I currently still get the message "svn: Can't open file '/svnroot/repos/cb-svn/format': Permission denied" when trying to check out anonymously (svn+ssh:// does work fine). Probably file permissions must be updated with the next cron job first? I'll look after it again tomorrow.

So long, have fun with it, more to come soon :)
"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
Bounty: CVS plugin
« Reply #22 on: July 12, 2005, 08:39:01 pm »
Added another "no-release" with a lot more functions today. In particular, property handling works for all properties now (the special ones have custom handlers or run from the menu), most of the preferences are actually respected, a few minor bugs have been fixed, revert works, and there is a minimalist diff viewer.
If you want to check out the sources, make sure to get r9, as r7 had some messing around with file permissions, so a few files were not transmitted properly. r9 checks out fine for me.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline squizzz

  • Almost regular
  • **
  • Posts: 132
Bounty: CVS plugin
« Reply #23 on: July 12, 2005, 11:58:50 pm »
Do you plan adding your plugin to official C::B /plugins/contrib CVS repository some day?
I have a strange feeling that your work misses a lot of audience because of not being there. Note that not many users use version control system at all, and even less use SVN (CVS is still more popular solution) - I think having it shipped with C::B sources would both popularize usage of SVN and your plugin much more. Just my 5 cents...

Now installing TortoiseSVN in order to grab your work. :)
this space is for rent

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Bounty: CVS plugin
« Reply #24 on: July 13, 2005, 12:21:29 am »
I agree with you, squizzz. After all, look at this thread title :P

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Bounty: CVS plugin
« Reply #25 on: July 13, 2005, 02:03:47 pm »
Quote from: squizzz
Do you plan adding your plugin to official C::B /plugins/contrib CVS repository some day?

Hmm... does this work at all? If it does, then I don't know how. It sure is very easy with CVS to set svn:externals on a directory to include another SVN repository in the tree, but I have no idea if CVS has any such thing. Rather, I think it would be necessary to migrate the project to CVS.
But you are of course very right, generally. It sure would be better for its popularity if it was in the CVS tree.
Lets wait until it is in a little more finished. For now, I dread to think about using CVS. If I get the CVS support right, though, maybe CVS could be lived with ;)
 
Quote from: squizzz
Note that not many users use version control system at all

Lol, yes, and CVS contributed a lot to that ;)
When I first thought about using revision control (somewhere around 1995), I was told there was RCS and CVS, the latter being the tool of choice, as it was so much better. So I looked at CVS, and this experience put me off revision control entirely.
At some point in 2002, however, I decided that no matter how painful, I had to start using revision control, as I spent a good quarter of my time messing with a hundred local copies of every file (well you know... you've been there).
Much to my surprise, subversion turned out to be not much of a pain at all. Setting up a functional repo and successfully importing a project took me 30 seconds after reading the docs (as opposed to 2 hours with CVS). And apart from very few occasions, it causes very very little grief (rarely, it gets a file access conflict, and bdb is not backwards compatible, so upgrading to Fedora 4 made my repos unusable - but well, one should use fsfs, anyway).
Thus it became he used subversion, and he lived long and happily ever after.

Quote from: rickg22
After all, look at this thread title

Ah yes, but a man can dream, can't he :)
Maybe Sourceforge finally releases SVN access one day, then no one will be wanting to use CVS any more. At BerliOS (which uses the sourceforge web interface, too), they have it running.
"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
Bounty: CVS plugin
« Reply #26 on: July 19, 2005, 07:46:59 pm »
Added another snapshot of today's sources as well as a binary release:
http://developer.berlios.de/project/showfiles.php?group_id=4084&release_id=6571

This one has support for TortoiseCVS and should do CVS checkout, update, and commit.

Should do? Well yes... should do. Lacking write access to a CVS server, I have no possibility to confirm that commit actually does anything, but I guess it does :)
The CVS code is quite awkward, but CVS is a really picky with its paramters, too. In particular, it messed around a lot when passed directories as targets. Finally, the code ended up with changing working directory and calling cvs with no target for directories. This is ugly and awkward, but it does not crash and burn...
Checking out code::blocks and freeBSD as "test suite" did work fine, and update seems to work, too. Authentication does work, I believe.
So if you have been waiting for CVS support, then this is the time to try and send feedback.

It seems to me that CVS is unable to do anything without network access. That implies that custom menus according to a file's state cannot be implemented for CVS-controlled projects (you would not want to possibly wait 30 seconds before the menu opens?).
The only way around seems to be parsing CVS/Root and comparing the commit times to file modification times manually.
Should this be a misconception of mine (being a no-CVS user, it is quite possible that I only lack the knowledge about the necessary switch), then I would appreciate being hinted to it :)
Is there anything like "svn status" in CVS?

Ah yes, and most important, the project now has a useless home page with a nice picture, and the dll has a new icon, too.
If you don't get something to work, then at least make it look good ;)
"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: 4315
    • Code::Blocks IDE
Bounty: CVS plugin
« Reply #27 on: July 19, 2005, 08:35:24 pm »
Quote
It seems to me that CVS is unable to do anything without network access.

Correct.
Quote
The only way around seems to be parsing CVS/Root and comparing the commit times to file modification times manually.

Yup, it's the only solution and it's a nightmare, especially around daylight saving times...

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

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Bounty: CVS plugin
« Reply #28 on: July 19, 2005, 09:05:29 pm »
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.
I 've also updated your project file to use the latest and greatest: custom variables. This allows for setting the main paths (wx, codeblocks, etc) in one place (project build options->custom variables) and all project settings are updated :)

Now for the usage:
I tried using your plugin with a project of mine which I have under SVN control (as I do with all my personal projects ;) ). I had 14 files modified to be commited. When I tried to commit them, I got this response:
Quote
svn: Commit failed (details follow):
svn: Can't create tunnel: The system cannot find the file specified.  

Any insight? (I've already setup the plugin's configuration)

Keep up the good work :)

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

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Bounty: CVS plugin
« Reply #29 on: July 19, 2005, 09:16:53 pm »
Quote from: mandrav
I 've corrected all the errors and will upload a patch for you at berlios.

Tough luck. Either berlios doesn't have a patch tracker or you haven't enabled it...
Anyway, here's the patch.

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