For those who would like to commit a complete folder/directory rather than just a single file, the following patch will do so.
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?