Author Topic: SVNInside : development of another SVN plugin for CodeBlocks  (Read 185557 times)

Offline JGM

  • Lives here!
  • ****
  • Posts: 518
  • Got to practice :)
Re: SVNInside : development of another SVN plugin for CodeBlocks
« Reply #30 on: October 10, 2007, 08:51:13 pm »
I was just reading the wxWidgets wiki and I found these links to be of interest:

http://libexecstream.sourceforge.net/
http://www.netbsd.org/~jmmv/process/

This was the url for reference:
http://www.wxwidgets.org/wiki/index.php/WxExecute
« Last Edit: October 10, 2007, 08:59:00 pm by JGM »

Offline orel

  • Multiple posting newcomer
  • *
  • Posts: 96
Re: SVNInside : development of another SVN plugin for CodeBlocks
« Reply #31 on: October 10, 2007, 09:32:03 pm »
Thank you for the links.

For information, i had tried wxExecute synchronously : no problem.
and asynchronously too : the coupling with a wxProcess could be a great thing in order to, for example, run a command taking a long time and using the wxProcess::OnTerminate() inherited function to refresh the GUI when that command end.  All my tries worked.

But, given the bad feedback about wxExecute from Thomas, i will keep for the moment my old windows C code in the SVN repository and will change it to something else if needed. I'll keep my wxExecute tries closer in case of...

For the moment, i will concentrate my effort into other aspects and features of the projects, making the code more robust, etc.

And for wxExecute, the question stays open !!
windows XP SP2
mingw gcc 3.4.5
svn Code::Blocks and M$ Visual Studio 2005 and .NET to eat!! SVNInside plugin :http://forums.codeblocks.org/index.php/topic,7063.0.html

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: SVNInside : development of another SVN plugin for CodeBlocks
« Reply #32 on: October 10, 2007, 10:10:25 pm »
IMO, you should use wxExecute (and wxProcess when needed) as your standard implementation (Despite the justified misgivings of Thomas). That way your code will *mostly* work on all platforms with minimal changes (my Shell Extensions plugin and Python Debugger plugin work on both Linux and Win32 and both use asynchronous processes with redirected output courtesy of wxProcess).  The best way to do this would be to write a class wrapper around wxExecute/wxProcess or extend the incomplete Process implementation in the C::B SDK. Then if you feel the need, you can later add platform specific implementations for process handling without having to modify the SVN specific code in your plugin.
« Last Edit: October 10, 2007, 10:12:49 pm by dmoore »

Offline orel

  • Multiple posting newcomer
  • *
  • Posts: 96
Re: SVNInside : development of another SVN plugin for CodeBlocks
« Reply #33 on: October 10, 2007, 10:53:38 pm »
EditorBase::Undo() is an empty virtual function which has been implemented in cbEditor. Try the following code.
Code
// Code to catch cbEVT_EDITOR_MODIFIED event
void foo::OnEditorModified(CodeBlocksEvent& event)
{
    cbEditor* ed = (cbEditor*)event.GetEditor();
    ed->Undo();
}

Or

Code
cbEditor* ed = Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor();
ed->Undo();

HTH. :)

No one of those code snippets is working. I simply don't understand how to do that.
windows XP SP2
mingw gcc 3.4.5
svn Code::Blocks and M$ Visual Studio 2005 and .NET to eat!! SVNInside plugin :http://forums.codeblocks.org/index.php/topic,7063.0.html

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: SVNInside : development of another SVN plugin for CodeBlocks
« Reply #34 on: October 11, 2007, 03:53:39 pm »
Patch to for building under windows without pre-compiled headers.

Tim S

Code
Index: src/Dialogs/wxSVNTreeCtrl.cpp
===================================================================
--- src/Dialogs/wxSVNTreeCtrl.cpp (revision 8)
+++ src/Dialogs/wxSVNTreeCtrl.cpp (working copy)
@@ -1,6 +1,7 @@
 #include <sdk.h> // Code::Blocks SDK
 #ifndef CB_PRECOMP
     #include <configmanager.h>
+    #include <cbeditor.h>
     #include <cbproject.h>
 #endif
 #include <wx/menu.h>
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: SVNInside : development of another SVN plugin for CodeBlocks
« Reply #35 on: October 12, 2007, 08:16:26 am »
Patch to for building under windows without pre-compiled headers.
Reminds me: Stahta01: What compiler config do you use to get these results? I tried installing GCC 3.3.1 but it never was able to link C::B with it (although I have compiled everything from scratch, including wx with 3.3.1).
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: SVNInside : development of another SVN plugin for CodeBlocks
« Reply #36 on: October 12, 2007, 08:34:08 am »
Patch to for building under windows without pre-compiled headers.
Reminds me: Stahta01: What compiler config do you use to get these results? I tried installing GCC 3.3.1 but it never was able to link C::B with it (although I have compiled everything from scratch, including wx with 3.3.1).

MinGW GCC 3.4.5, note I tried it with 3.3.1, but more work is needed on it.

You need to remove the defines of CB_PRECOMP and WX_PRECOMP in the Code::Blocks project file.
Then add the define of NOPCH.

Tim S
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline orel

  • Multiple posting newcomer
  • *
  • Posts: 96
Re: SVNInside : development of another SVN plugin for CodeBlocks
« Reply #37 on: October 12, 2007, 10:41:28 am »
As some of you may have see, i commited all patches posted on this topic, and made a little effort in the source code to translate french comments to english, not all of them for the moment are but they will soon.

I am also reorganizing my code to let it be more readable and changins some interfaces, specially CSNComand class and inheriteds ones.

Fot the moment, that works :
  • plugi config is save in th e project file when configured. But for the moment, you must save it, close it and reopen for the svn tree to be full
  • adding 'not under svn control 'files to the repository, if their directory exists in the repo. Batch version too
  • commiting added, modified, deleted or replaced files.  Batch version too
windows XP SP2
mingw gcc 3.4.5
svn Code::Blocks and M$ Visual Studio 2005 and .NET to eat!! SVNInside plugin :http://forums.codeblocks.org/index.php/topic,7063.0.html

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: SVNInside : development of another SVN plugin for CodeBlocks
« Reply #38 on: October 12, 2007, 10:46:07 am »
You need to remove the defines of CB_PRECOMP and WX_PRECOMP in the Code::Blocks project file.
Then add the define of NOPCH.
Oh - that way... nice catch. Thanks! :-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline orel

  • Multiple posting newcomer
  • *
  • Posts: 96
Re: SVNInside : development of another SVN plugin for CodeBlocks
« Reply #39 on: October 14, 2007, 09:22:52 pm »
Interfaces of CSVNCommand and inherited classes have been redesigned to be clearer and more understandable. All classes named CSVN...Result and CSVN...Params no more exist. Everything is done in  CSVN... classes.

Next step will be the integration of wxExecute and wxProcess in the execution of svn commands, in order to have 2 choices when executing one command :
     -synchronous execution for commands executing fastly
     -asynchronous execution for slower commands, with a notification of the end of the process by sending a wxEvent to an wxEventHandler, the event being given to the CSVNCommand at runtime.

I have made some tests with both, and everything is OK, no problem when getting the command line output.

I will keep my windows implementation of this, but it won't be the default, even for windows users. This code will be compiled only if something like WINAPI_IMPLEMENTATION is defined.

This is the only step tobe coded for SVNInside to be cross compiled. When this will be done, i would be glad if a linux user can try it on his PC, just to see if there are problems. The coding won't be finished at all at this time, but at least it will take place on solid bases.

If some of you have ideas for this plugin, it's time to give them, before other choices have been made and so it's more difficult to reimplement.

Thank eveybody for your interest, ideas, patches and programming advises!! :D

orel
« Last Edit: October 14, 2007, 09:27:15 pm by orel »
windows XP SP2
mingw gcc 3.4.5
svn Code::Blocks and M$ Visual Studio 2005 and .NET to eat!! SVNInside plugin :http://forums.codeblocks.org/index.php/topic,7063.0.html

Offline orel

  • Multiple posting newcomer
  • *
  • Posts: 96
Re: SVNInside : development of another SVN plugin for CodeBlocks
« Reply #40 on: October 19, 2007, 12:38:45 am »
A bunch of modifications have been commited into SVNInside repository (accessible for everyone)
Now, code should compile and work also for linux users, there isn't a windows line anymore.

Note that i don't have a linux platform for the moment, so maybe i'm wrong with something, please tell me if you try it.
Note also that this is always a work in progress. I would appreciate anyone experience on my wxWidgets programming, the way i parse svn command line, or anything else


If you fall on an bug and want to help, please copy (if possible)  and paste what is on the 'Debug Log' message Pane of CB. If you build a debug version of SVNInside, every svn command line stdin, stdout and stderr will be printed on this pane.
« Last Edit: October 19, 2007, 12:44:43 am by orel »
windows XP SP2
mingw gcc 3.4.5
svn Code::Blocks and M$ Visual Studio 2005 and .NET to eat!! SVNInside plugin :http://forums.codeblocks.org/index.php/topic,7063.0.html

Offline JGM

  • Lives here!
  • ****
  • Posts: 518
  • Got to practice :)
Re: SVNInside : development of another SVN plugin for CodeBlocks
« Reply #41 on: October 19, 2007, 04:37:30 am »
A bunch of modifications have been commited into SVNInside repository (accessible for everyone)
Now, code should compile and work also for linux users, there isn't a windows line anymore.

Thats great news! Finally somebody made the job  :D

Offline wvdakker

  • Multiple posting newcomer
  • *
  • Posts: 15
Re: SVNInside : development of another SVN plugin for CodeBlocks
« Reply #42 on: October 21, 2007, 10:17:48 pm »
When does this plug-in make it into the CB nighties? I cant compile it because I have the SDK not available...

Thanks,
Willem

Offline orel

  • Multiple posting newcomer
  • *
  • Posts: 96
Re: SVNInside : development of another SVN plugin for CodeBlocks
« Reply #43 on: October 23, 2007, 11:05:29 pm »
When does this plug-in make it into the CB nighties?

First, as i have told, this plugin is under construction, no planning has been made about its release... Also i began to develop it 6 weeks ago, alone, to learn wxWidgets and CB API, when i thank it would be great to share it to the cstart a new topicommunity, while i could get feedback and ideas from other users/developers, that's why i started a new topic.

I began a new job some weeks ago in software development which takes me a big part of my time, as almost anybody here, and try to find time for my personal developments.

Second, i am not part of the official CB staff, so, even if my plugin was released, i don't know at all if one day it would be included in the official CB plugins list or in the nightlies, though it would be great... ;-)

Today, the only thing i can tell you is that i work almost everyday on SVNInside and i always try get to the end of something i begin.

I cant compile it because I have the SDK not available...

That's a problem i met when i first wanted to test a CB plugin. The only solution i found was to compile CB and use the plugin with this cb version. CB doesn't have many dependencies (only wxWidgets if i remember) so that's made a relatively easily task, if you RTFM and maybe ask some help after.

For the moment, if you really need a working svn plugin in CB, there is cbTortoiseSVN, try it.

sincerely,

orl
windows XP SP2
mingw gcc 3.4.5
svn Code::Blocks and M$ Visual Studio 2005 and .NET to eat!! SVNInside plugin :http://forums.codeblocks.org/index.php/topic,7063.0.html

Offline orel

  • Multiple posting newcomer
  • *
  • Posts: 96
Re: SVNInside : development of another SVN plugin for CodeBlocks
« Reply #44 on: October 26, 2007, 01:36:10 am »
For those who are expecting a SVNInside release, i must tell you that i am changing the behaviour of tree tab. It was a bad idea to sort the files in folder, in respect to their svn status. Though it's easy to use with small projects, it begins to be annoying and not very instinctive when you have to deal with larger projects.

So, the tree will totally reflect the directory structure of your working copy, with differents icons for files having different status, the directories icons will also reflect their svn status.

I added a new tab in the 'messages pane' where svn command line input, normal and error output are printed. I also use it for the moment to print debug infos, can be useful to get user feedback about bugs.

The changes have not yet been commited to the repository (on Assembla) but they will be this weekend.
I will inform you of that and for any new features added.

Features that will be added soon are :

-possibility to see the difference between one file and another in the repository (any revision), the result will be viewable in a diff viewer of your choice (by using its command line parameters) or in C::B(the unified diff file given by 'svn diff' command)

-something like a property grid under the tree to watch properties of files like current revision, lock owner, date, url in repo, etc.

-the new 'messages pane' SVNInside tab will, like the squirrel script one, give the user the possibility to send suversion commands within C::B,  and see the output. Can be useful for 'subversion gurus' or those who want instant access to 'more exotic commands' not featured in SVNInside.

- A 'Refresh' buton for the SVNInside tree : in order to reflect some changes made from 'the outside' to the working copy, or by using the command line within C::B.

-what YOU think can be useful to a plugin like this one...
windows XP SP2
mingw gcc 3.4.5
svn Code::Blocks and M$ Visual Studio 2005 and .NET to eat!! SVNInside plugin :http://forums.codeblocks.org/index.php/topic,7063.0.html