Author Topic: SVN plugin  (Read 104761 times)

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
SVN plugin
« on: June 07, 2005, 07:38:24 pm »
I am working on a Subversion plugin right now, still fighting alternately with the SDK and wxWidgets.
Currently, the plugin works only as much as providing "update" and "commit" for HEAD on either single files or project directories via right-click on the project manager and progress feedback in a SimpleTextlog. Not quite finished, as you must do stuff like import and  checkout with Tortoise, but hey, it is a start ;)
If wxWidgets is not giving me too much of a hard time, then the plugin should be "usable" until the end of the week.

Once everything works fine for svn, it should not be too hard to include cvs as well. I have always avoided using cvs, so my knowledge on that particular thing is limited, but as I understand it, svn syntax is pretty much the same (as svn is meant to replace cvs). Therefore, cvs support might be as easy as chaning three letters? :)
"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 #1 on: June 07, 2005, 08:08:37 pm »
Cool! Thanks a lot!! :D

Please keep us informed.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Bounty: CVS plugin
« Reply #2 on: June 07, 2005, 08:47:09 pm »
Quote
Therefore, cvs support might be as easy as chaning three letters?

Not exactly, but close ;)

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

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Bounty: CVS plugin
« Reply #3 on: June 08, 2005, 12:10:30 am »
Maybe you could add a special case for when tortoise is installed, and call it instead. :)

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Bounty: CVS plugin
« Reply #4 on: June 09, 2005, 06:23:32 pm »
Quote from: rickg22
Maybe you could add a special case for when tortoise is installed, and call it instead. :)


It never occured to me one could call tortoise from a command prompt (don't we install it to avoid a shell), but hey, that is an ingenious idea. It is actually intended that way, and works like a charm.

For Windows users, that is surely the way to go, it will be hard to make the Interface as good as or better than tortoise is already, so why not use it.
Sadly, tortoise is not precisely available on Linux, so I guess it still must have a fallback ;)
"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 #5 on: June 09, 2005, 07:33:15 pm »
In fact I wanted to write said plugin, but never had the time. I spoke with one of the tortoise devs, and they told me that the file in question was tortoiseact.exe. But first get the CVS going, later we could do the tortoise stuff.

Still, I'd like the menu to look like Tortoise's: Like "update","update special", etc.

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Bounty: CVS plugin
« Reply #6 on: June 09, 2005, 11:50:01 pm »
Tortoise CVS as well as WinCVS
are using cvsnt

i've installed a separate version of cvsnt on my harddisk and have Tortoise
as well as WinCVS working in parallel, using the cvsnt version.
it's easy to configure, both cvs GUI frontends have some option dialogs for this.

the cvsnt version comes with an excellent documentation and the commandline tool cvs.exe
can be used in parallel to the GUI cvs stuff,
sometimes small batchfile scripts are more convenient than all that right-click menu stuff.

[addendum]
what's svn ? can someone pass a link please ?

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Bounty: CVS plugin
« Reply #7 on: June 10, 2005, 01:45:25 am »
SVN: SubVersioN. http://subversion.tigris.org/ - it's a software similar to CVS.

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Bounty: CVS plugin
« Reply #8 on: June 10, 2005, 02:18:16 am »
Quote from: rickg22
SVN: SubVersioN. http://subversion.tigris.org/ - it's a software similar to CVS.


@rick: thanks for the link !

svn looks promising, no more broken repositories if they tell us the truth...

Quote from: the following is taken from: Version Control System Comparison
Support for atomic commits means that if an operation on the repository is interrupted in the middle, the repository will not be left in an inconsistant state. Are the check-in operations atomic? Are the check-in operations atomic, or can interrupting an operation leave the repository in an intermediate state?

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
Bounty: CVS plugin
« Reply #9 on: June 10, 2005, 08:48:34 am »
svn is very promising indeed, only I don't get it working very easily :) (I think I want to go to fast...)
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Bounty: CVS plugin
« Reply #10 on: June 10, 2005, 08:49:23 am »
Quote
svn looks promising, no more broken repositories if they tell us the truth...

Oh, they are :D
I 've been using it for my personal projects for over a year now and it's much better than CVS.

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

upCASE

  • Guest
Bounty: CVS plugin
« Reply #11 on: June 10, 2005, 11:25:25 am »
Hi!
Right, SVN really rocks. We're using it in the company I'm working for and skipped to it after using CVS. No problems yet (exept those we already had with CVS, like being to stupid to commit or failing to resolve conflicts :D)

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Bounty: CVS plugin
« Reply #12 on: June 22, 2005, 06:06:01 pm »
Just a little update in case you think I have unexpetedly died  :P
Due to a few pecularities, it takes longer than I had ever expected, but it seems like the end is getting a little closer.

So, here is a little status report to let you know what works (and what does not) so far:

checkout
- works, still needs to have a MRU added
- auto-open project not implemented yet

auto-discover svn and tortoise
- works fine on WIN32, should work on Linux too

import tortoise repo MRU
- I almost committed suicide on that... another time maybe

import
- not yet

update file / update project (from context menu)
- works fine including revisions, but does not handle conflicts yet

commit file / commit project (from context menu)
- works fine, but does not handle conflicts yet

branch
- works if Tortoise is installed
switch
- works if Tortoise is installed
merge
- works if Tortoise is installed
Tortoise support is still a bit awkward as it will currently only run with a nasty hack. I have not figured why, though.
The issue is that if I call it using wxExec, it is cold as a dead fish. This was quite surprising and cost me a lot of time.
The workaround is to start cmd /C to call tortoise, this works, but I have no idea why. Maybe a wxWindows issue?


auto-add nonversioned files (configurable)
- works

auto-add when adding to project (configurable)
- works

auto-delete when deleting from project
- had planned that, but not sure one would really want this

auto-handle missing files
- not yet

svn properties browseable in context menu
- Yes! Particularly proud of that, this is one thing I actually got better than Tortoise has it  :)

add new file properties / edit
- almost :)

svn delete from context menu
- works

svn move from context menu
- Uhhh... (yes... although it occasionally crashes the project manager...
have not figured how to remove a file and re-add it properly, multiple build targets don't really make it easier)

revert
- Uhhh... this *should* work, although it occasionally caused a "cannot create file" error, so I postponed it for now. Maybe the test repository is just screwed up...

log/history browser
- nothing yet

diff
- nothing yet

resolve
- nothing yet

lock
- locks? locks are evil.

cleanup
- not yet
"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 #13 on: June 22, 2005, 06:15:04 pm »
Hmmm I wonder if having "the project" intermingled with cvs/svn is a good idea - i mean, shouldn't the versioning system take care of what files belong to a module?

Just a suggestion.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Bounty: CVS plugin
« Reply #14 on: June 23, 2005, 12:51:03 pm »
You don't need to turn it on if you don't want it :)
Personally I am a lazy bastard, and I expect files added to revision control even when I copy them into the folder (why should I bother if the computer can do the work). 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.
Other people feel different of course, and many have a problem with the computer doing things behind their back. Certainly understandable. You're free to choose, however.

The plugin runs 'svn status' when opening the project and before committing just like tortoise does, too (*). While tortoise will ask you "add these?" every time, you can tell the plugin to just do so silently.
The "add when added" function is much like tortoise's "svn copy here" command.

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.
The thing I have in mind is some sites have a policy like "only commit a revision that builds without errors, or you are publicly humiliated and ostracised for seven generations".  
For these, and to save on aspirin, an option "require clean build before commit" might be worth consideration.


(*) this is an understatement. Actually  'svn status' is called an awful lot of times. This sounds like mega-overhead, but it is actually quite fast and it does not need network (on my machine 20-100 ms). The gains are huge: BuildModuleMenu, for example, builds a custom menu for every file, only showing 'commit' if the file is actually modified, and listing file properties ('svn pl') in a submenu.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."