Author Topic: TortoiseSVN plugin  (Read 33614 times)

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
Re: TortoiseSVN plugin
« Reply #15 on: October 06, 2006, 02:49:50 pm »
same problem here... I thought that the plugin was surging for tortoise before it showed the menu, but that isn't the case (as far as I can see in the source.)
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: TortoiseSVN plugin
« Reply #16 on: October 06, 2006, 03:42:22 pm »
I too have had this problem. But not just with CBTortoiseSVN. Once in a while CB just does not load a plugin. I cannot catch the cause.

But It always says "invalid manifest" in the debug log when it does this.

I then copy the same .zip file over the old .zip manifest file and it works. wierd!

I noticed this happens to me when updating the manifest.xml.
When I stopped updating the manifest, the problem only happens when installing a new plugin.

I've stepped through the code, but can find no cause unless the .zip handler  is failing.

Anyway, try simply recopying the CBTortoiseSVB.zip into .../share/codeblocks . I'm aware that this is voodoo....

Edit: I've found this new manifest method of loading plugins to be very tricky to get right. It take a lot of time and seldom works for me the first time or two.

CBTortoiseSVN does work however. I have it running on XPsp2.
It took about an hour to get CB to recognize it, dicking with the manifest, but I don't know why.
I've just learned, once working, never to touch a manifest ever again.
« Last Edit: October 06, 2006, 04:08:18 pm by Pecan »

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
Re: TortoiseSVN plugin
« Reply #17 on: October 06, 2006, 04:42:53 pm »
That doesn't work :S The plugin name in the manifest file is wrong :S
<Plugin name="C::B TortoiseSVN"> should be <Plugin name="CBTortoiseSVN">

but this was already told, could someone post the changed version?
« Last Edit: October 06, 2006, 04:46:10 pm by mispunt »
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: TortoiseSVN plugin
« Reply #18 on: October 06, 2006, 05:10:30 pm »
That doesn't work :S The plugin name in the manifest file is wrong :S
<Plugin name="C::B TortoiseSVN"> should be <Plugin name="CBTortoiseSVN">

but this was already told, could someone post the changed version?

What doesn't work? This works (posted previously)
Code
?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_plugin_manifest_file>
    <SdkVersion major="1" minor="10" release="0" />
    <Plugin name="CBTortoiseSVN">
        <Value title="C::B TortoiseSVN" />
        <Value version="1.0" />
        <Value description="C::B TortoiseSVN" />
        <Value author="Jan van den Borst" />
        <Value authorEmail="" />
        <Value authorWebsite="http://www.codeblocks.org" />
        <Value thanksTo="Code::Blocks Development Team" />
        <Value license="GPL" />
    </Plugin>
</CodeBlocks_plugin_manifest_file>

And the plugin posted previously works.


Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
Re: TortoiseSVN plugin
« Reply #19 on: October 06, 2006, 05:21:21 pm »
What doesn't work? This works (posted previously)
Code
?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_plugin_manifest_file>
    <SdkVersion major="1" minor="10" release="0" />
    <Plugin name="CBTortoiseSVN">
        <Value title="C::B TortoiseSVN" />
        <Value version="1.0" />
        <Value description="C::B TortoiseSVN" />
        <Value author="Jan van den Borst" />
        <Value authorEmail="" />
        <Value authorWebsite="http://www.codeblocks.org" />
        <Value thanksTo="Code::Blocks Development Team" />
        <Value license="GPL" />
    </Plugin>
</CodeBlocks_plugin_manifest_file>

And the plugin posted previously works.
This manifest file is working indeed, but ths is not in the previously posted zip file..
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: TortoiseSVN plugin
« Reply #20 on: October 06, 2006, 07:19:44 pm »
For those who would like to commit a complete folder/directory rather than just a single file, the following patch will do so.

Code
Index: CBTortoiseSVN.cpp
===================================================================
--- CBTortoiseSVN.cpp (revision 42)
+++ CBTortoiseSVN.cpp (working copy)
@@ -5,6 +5,7 @@
 //* Copyright: (c) Jan van den Borst
 //* License:   GPL
 //******************************************************************************
+#include <wx/filedlg.h>
 
 #include "CBTortoiseSVN.h"
 #include "cbeditor.h"
@@ -17,6 +18,7 @@
 static int idCBTortoiseSVN = wxNewId();
 static int idAdd           = wxNewId();
 static int idCommit        = wxNewId();
+static int idCommitPath    = wxNewId();
 static int idDiffWithBase  = wxNewId();
 static int idLog           = wxNewId();
 static int idRepobrowser   = wxNewId();
@@ -36,6 +38,7 @@
 BEGIN_EVENT_TABLE(CBTortoiseSVN, cbPlugin)
 EVT_MENU(idAdd,                 CBTortoiseSVN::OnAdd)
 EVT_MENU(idCommit,              CBTortoiseSVN::OnCommit)
+EVT_MENU(idCommitPath,          CBTortoiseSVN::OnCommitPath)
 EVT_MENU(idDiffWithBase,        CBTortoiseSVN::OnDiffWithBase)
 EVT_MENU(idLog,                 CBTortoiseSVN::OnLog)
 EVT_MENU(idRepobrowser,         CBTortoiseSVN::OnRepobrowser)
@@ -102,6 +105,7 @@
     TortoiseSVN_submenu->Append(idDiffWithBase,  _("Diff with base..."),   _("Diff with base"));
     TortoiseSVN_submenu->Append(idAdd,           _("Add..."),              _("Add"));
     TortoiseSVN_submenu->Append(idCommit,        _("Commit..."),           _("Commit"));
+    TortoiseSVN_submenu->Append(idCommitPath,    _("Commit Path..."),      _("Commit Path"));
     TortoiseSVN_submenu->Append(idLog,           _("Log..."),              _("Log"));
     TortoiseSVN_submenu->Append(idRepobrowser,   _("Repobrowser..."),      _("Repobowser"));
     TortoiseSVN_submenu->Append(idRevisiongraph, _("Revisiongraph..."),    _("Revisiongraph"));
@@ -125,6 +129,11 @@
 
 void CBTortoiseSVN::RemoveMenu(wxMenuBar *menuBar)
 {
+    //(pecan 2006/10/04)
+    // It is not necessary to remove menu items and can cause a 3 to 10
+    // second delay durling program termination
+    return;
+
     wxMenu *menu = 0;
     wxMenuItem *item = menuBar->FindItem(idCBTortoiseSVN, &menu);
 
@@ -279,7 +288,43 @@
 {
     RunSimpleTortoiseSVNCommand(_("commit"));
 }
+//******************************************************************************
+// ----------------------------------------------------------------------------
+void CBTortoiseSVN::OnCommitPath(wxCommandEvent &event)  //(pecan 2006/10/05)
+// ----------------------------------------------------------------------------
+{
+    wxString filename;
+    if (!GetCurrentFilename(filename))
+        return;
 
+    // Ask user for path to commit
+    wxString pathName;
+    pathName = AskForPathName();
+    if ( pathName.IsEmpty() ) return;
+
+    if (!FileUnderVersionControl(pathName))
+    {
+        wxMessageBox(pathName + _("\nPath is not a working copy."), _("Info"),
+                     wxOK | wxICON_INFORMATION);
+        return;
+    }
+
+    wxString command = wxT("commit");
+    wxString commandline =
+        _("TortoiseProc /command:")
+        + command
+        + _(" /path:\"")
+        + pathName
+        +_("\" /notempfile");
+
+    //-wxMessageBox( commandline,wxT("commit Project"));
+
+    DWORD exit_code;
+    if (!Run(false, false, commandline, exit_code))
+        wxMessageBox(_("Command \"") + commandline + _("\" failed"), _("Info"),
+                     wxOK | wxICON_ERROR);
+}
+
 //******************************************************************************
 
 void CBTortoiseSVN::OnDiffWithBase(wxCommandEvent &event)
@@ -331,3 +376,44 @@
 
 //******************************************************************************
 // End of file
+// ----------------------------------------------------------------------------
+wxString CBTortoiseSVN::AskForFileName()       //(pecan 2006/10/06)
+// ----------------------------------------------------------------------------
+{
+    wxString newFileName = wxEmptyString;
+
+    // Ask user for filename
+    wxFileDialog dlg(::wxGetTopLevelParent(0),  //parent  window
+                 _("Select path "),             //message
+                 wxEmptyString,                 //default directory
+                 wxEmptyString,                 //default file
+                 wxT("*.*"),                    //wildcards
+                 wxOPEN | wxFILE_MUST_EXIST );  //style
+
+   // move dialog into the parents frame space
+    wxPoint mousePosn = ::wxGetMousePosition();
+    (&dlg)->Move(mousePosn.x, mousePosn.y);
+
+    if (dlg.ShowModal() != wxID_OK) return wxEmptyString;
+    return newFileName = dlg.GetPath();
+}
+// ----------------------------------------------------------------------------
+wxString CBTortoiseSVN::AskForPathName()       //(pecan 2006/10/06)
+// ----------------------------------------------------------------------------
+{
+    wxString newPathName = wxEmptyString;
+
+    // Ask user for filename
+    wxDirDialog dlg(::wxGetTopLevelParent(0),   //parent  window
+                 _("Select path "),             //message
+                 ::wxGetCwd(),                  //default directory
+                 wxDD_DEFAULT_STYLE );          //style
+
+   // move dialog into the parents frame space
+    wxPoint mousePosn = ::wxGetMousePosition();
+    (&dlg)->Move(mousePosn.x, mousePosn.y);
+
+    if (dlg.ShowModal() != wxID_OK) return wxEmptyString;
+    return newPathName = dlg.GetPath();
+}
+
Index: CBTortoiseSVN.h
===================================================================
--- CBTortoiseSVN.h (revision 41)
+++ CBTortoiseSVN.h (working copy)
@@ -47,6 +47,12 @@
         void OnLock(wxCommandEvent &event);
         void OnUnLock(wxCommandEvent &event);
         void OnUpdateUI(wxUpdateUIEvent &event);
+
+        void     OnCommitPath(wxCommandEvent &event);           //(pecan 2006/10/05)
+        wxString AskForFileName();                              //(pecan 2006/10/06)
+        wxString AskForPathName();                              //(pecan 2006/10/06)
+
+
     private:
         bool FileUnderVersionControl(const wxString& filename);
         bool Run(bool blocked, bool hidden, const wxString& command, DWORD& exit_code );
@@ -59,4 +65,10 @@
 };
 
 #endif // _CBTORTOISESVN_H
+// ----------------------------------------------------------------------------
+//  commit  1.0.01 2006/10/6
+//          Placed menu under CB Tools menu item
+//  commit  1.0.02 2006/10/6
+//          Added OnCommitPath menu & routine
+// ----------------------------------------------------------------------------
 


This is a very nice plugin. I think it's gonna get a lot of use. Could we add it to the contribs?

Offline orel

  • Multiple posting newcomer
  • *
  • Posts: 96
Re: TortoiseSVN plugin
« Reply #21 on: October 07, 2006, 01:33:22 am »
No luck....

I definitely can't make CBTortoiseSVN work. I even tried 'the voodoo way' (i.e trying to recopy the same zip on itself).

Did you guys have compile CB by yourselves or are you using nightly builds.  I am using nightly builds, do you think this may have an influence on the plugin ?

I know it must be useless, but can someone working on win32 post his dll AND his zip file, and also tell me if he compiled CB or used the nighlty build ?

That would be really nice... :D

I am using CB and Tortoise everyday, so it would be really stupid not to have them embedded each other...
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 Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: TortoiseSVN plugin
« Reply #22 on: October 07, 2006, 03:50:01 am »
I know it must be useless, but can someone working on win32 post his dll AND his zip file, and also tell me if he compiled CB or used the nighlty build ?

Ok, the following url points to CBTortoiseSVN.zip on SaveFile.com.
It contains both the debug and release versions of the dll along with the code and mainifest built with SVN 3001.

Note: this version has been modified to allow commits from a path, and places the menu as a submenu under Tools.

http://savefile.com/files/136874

Offline orel

  • Multiple posting newcomer
  • *
  • Posts: 96
Re: TortoiseSVN plugin
« Reply #23 on: October 07, 2006, 12:22:03 pm »
Thank you very much Pecan, very kind of you

but....

I just put the dll and the zip file where they must be.

And this time, there is an improvement :

I have something written about the plugin in the debug log :

the problem is that it is written that the plugin was not loaded, saying that maybe symbols are missing.

I also have a message after this saying that the plugin might be built for a different version of the sdk...

This is the same with the debug and release version of the plugin

i have the latest nightly build (revision 3023).... I don't understand anything.
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 Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: TortoiseSVN plugin
« Reply #24 on: October 07, 2006, 02:05:05 pm »
but....
the problem is that it is written that the plugin was not loaded, saying that maybe symbols are missing.
I also have a message after this saying that the plugin might be built for a different version of the sdk...
i have the latest nightly build (revision 3023).... I don't understand anything.

Ok. Hold on. I'll update and re-compile. I'll post a message when it's done.

Edit: Here is a url for CBTortoise.zip build from SVN 3029 containing code, debug and release .dll's along with the manifest & manifest in a CBTortoiseSVN.zip file.

If this does not work with your nightly build, then you are out of luck until the devs include it in the nightly build.

Secondly, I do not understand why it does not work with your nightly unless you are using the Ansi build. This is a Unicode build. It will not work with the Ansi.

http://savefile.com/files/138509
« Last Edit: October 07, 2006, 02:46:38 pm by Pecan »

Offline orel

  • Multiple posting newcomer
  • *
  • Posts: 96
Re: TortoiseSVN plugin
« Reply #25 on: October 07, 2006, 08:40:02 pm »
Quote
If this does not work with your nightly build, then you are out of luck until the devs include it in the nightly build.[/quote

I must be unlucky because everything is the same with this new version, even with both last nightly builds.
And yes, i'm on C::B Unicode.

However, I have to thank you, Pecan, for helping me out with all that stange stuff.

So  Devs !!! :D 

CAN YOU INCLUDE THIS SO USEFUL TORTOISESVN PLUGIN FOR EVERYBODY IN NEXT BUILDS...  :lol:

'til that time, I'll try again to find where that problem is coming from...
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 Jan van den Borst

  • Multiple posting newcomer
  • *
  • Posts: 99
Re: TortoiseSVN plugin
« Reply #26 on: December 11, 2006, 11:56:52 am »
Made a new version with new functions added...


[attachment deleted by admin]

Offline dwmcqueen

  • Multiple posting newcomer
  • *
  • Posts: 56
Re: TortoiseSVN plugin
« Reply #27 on: June 28, 2007, 07:56:30 pm »
This plugin fully functional in latest CB SVN?

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: TortoiseSVN plugin
« Reply #28 on: June 28, 2007, 11:17:30 pm »
This plugin fully functional in latest CB SVN?

I use it almost everyday, but it's for MSwindows only.

Offline kurapix

  • Multiple posting newcomer
  • *
  • Posts: 68
Re: TortoiseSVN plugin
« Reply #29 on: June 29, 2007, 05:12:18 am »
By reading the topic ... this plugin seems good :D ... but I can't use it since I'm using Ubuntu 7.04 >.< .

Kurapix
Code::Blocks package building script