OSDN Git Service

Add SVN DCommit Command
authorFrank Li <lznuaa@gmail.com>
Sat, 27 Jun 2009 15:54:03 +0000 (23:54 +0800)
committerFrank Li <lznuaa@gmail.com>
Sat, 27 Jun 2009 15:54:03 +0000 (23:54 +0800)
Signed-off-by: Frank Li <lznuaa@gmail.com>
src/Resources/TortoiseProcENG.rc
src/TortoiseProc/Commands/Command.cpp
src/TortoiseProc/Commands/SVNDCommitCommand.cpp [new file with mode: 0644]
src/TortoiseProc/Commands/SVNDCommitCommand.h [new file with mode: 0644]
src/TortoiseProc/Commands/SVNRebaseCommand.cpp [new file with mode: 0644]
src/TortoiseProc/Commands/SVNRebaseCommand.h [new file with mode: 0644]
src/TortoiseProc/TortoiseProc.vcproj
src/TortoiseProc/resource.h

index d240b74..aa57bcd 100644 (file)
Binary files a/src/Resources/TortoiseProcENG.rc and b/src/Resources/TortoiseProcENG.rc differ
index 8466501..22bf3a2 100644 (file)
@@ -62,7 +62,8 @@
 #include "SendMailCommand.h"\r
 #include "CatCommand.h"\r
 #include "RefBrowseCommand.h"\r
-\r
+#include "SVNDCommitCommand.h"\r
+#include "SVNRebaseCommand.h"\r
 \r
 #if 0\r
 \r
@@ -178,7 +179,9 @@ typedef enum
        cmdSubUpdate,\r
        cmdSubSync,\r
        cmdRefLog,\r
-       cmdRefBrowse\r
+       cmdRefBrowse,\r
+       cmdSVNDCommit,\r
+       cmdSVNRebase,\r
        \r
 } TGitCommand;\r
 \r
@@ -254,6 +257,8 @@ static const struct CommandInfo
        {       cmdSubSync,                     _T("subsync")                   },\r
        {       cmdRefLog,                      _T("reflog")                    },\r
        {       cmdRefBrowse,           _T("refbrowse")                 },\r
+       {       cmdSVNDCommit,          _T("svndcommit")                },\r
+       {       cmdSVNRebase,           _T("svnrebase")                 },\r
 };\r
 \r
 \r
@@ -365,6 +370,10 @@ Command * CommandServer::GetCommand(const CString& sCmd)
                return new CatCommand;\r
        case cmdRefBrowse:\r
                return new RefBrowseCommand;\r
+       case cmdSVNDCommit:\r
+               return new SVNDCommitCommand;\r
+       case cmdSVNRebase:\r
+               return new SVNRebaseCommand;\r
 #if 0\r
 \r
        \r
diff --git a/src/TortoiseProc/Commands/SVNDCommitCommand.cpp b/src/TortoiseProc/Commands/SVNDCommitCommand.cpp
new file mode 100644 (file)
index 0000000..2179884
--- /dev/null
@@ -0,0 +1,56 @@
+// TortoiseGit - a Windows shell extension for easy version control\r
+\r
+// Copyright (C) 2007-2008 - TortoiseGit\r
+\r
+// This program is free software; you can redistribute it and/or\r
+// modify it under the terms of the GNU General Public License\r
+// as published by the Free Software Foundation; either version 2\r
+// of the License, or (at your option) any later version.\r
+\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software Foundation,\r
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\r
+//\r
+#include "StdAfx.h"\r
+#include "SVNDCommitCommand.h"\r
+\r
+#include "SysProgressDlg.h"\r
+#include "ProgressDlg.h"\r
+#include "MessageBox.h"\r
+#include "RenameDlg.h"\r
+#include "Git.h"\r
+#include "ShellUpdater.h"\r
+#include "CommonResource.h"\r
+\r
+bool SVNDCommitCommand::Execute()\r
+{\r
+       if(!g_Git.CheckCleanWorkTree())\r
+       {\r
+               if(CMessageBox::Show(NULL,      IDS_ERROR_NOCLEAN_STASH,IDS_APPNAME,MB_YESNO|MB_ICONINFORMATION)==IDYES)\r
+               {\r
+                       CString cmd,out;\r
+                       cmd=_T("git.exe stash apply ");\r
+                       if(g_Git.Run(cmd,&out,CP_ACP))\r
+                       {\r
+                               CMessageBox::Show(NULL,out,_T("TortoiseGit"),MB_OK);\r
+                               return false;\r
+                       }\r
+\r
+               }else\r
+               {\r
+                       return false;\r
+               }\r
+       }\r
+\r
+       CProgressDlg progress;\r
+       progress.m_GitCmd=_T("git.exe svn dcommit");\r
+       if(progress.DoModal()==IDOK)\r
+               return TRUE;\r
+\r
+       return true;\r
+}\r
diff --git a/src/TortoiseProc/Commands/SVNDCommitCommand.h b/src/TortoiseProc/Commands/SVNDCommitCommand.h
new file mode 100644 (file)
index 0000000..1e02c7a
--- /dev/null
@@ -0,0 +1,35 @@
+// TortoiseGit - a Windows shell extension for easy version control\r
+\r
+// Copyright (C) 2007 - TortoiseGit\r
+\r
+// This program is free software; you can redistribute it and/or\r
+// modify it under the terms of the GNU General Public License\r
+// as published by the Free Software Foundation; either version 2\r
+// of the License, or (at your option) any later version.\r
+\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software Foundation,\r
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\r
+//\r
+#pragma once\r
+#include "Command.h"\r
+\r
+/**\r
+ * \ingroup TortoiseProc\r
+ * Copies dropped items.\r
+ */\r
+class SVNDCommitCommand : public Command\r
+{\r
+public:\r
+       /**\r
+        * Executes the command.\r
+        */\r
+       virtual bool                    Execute();\r
+};\r
+\r
+\r
diff --git a/src/TortoiseProc/Commands/SVNRebaseCommand.cpp b/src/TortoiseProc/Commands/SVNRebaseCommand.cpp
new file mode 100644 (file)
index 0000000..be3c9c1
--- /dev/null
@@ -0,0 +1,32 @@
+// TortoiseGit - a Windows shell extension for easy version control\r
+\r
+// Copyright (C) 2007-2008 - TortoiseGit\r
+\r
+// This program is free software; you can redistribute it and/or\r
+// modify it under the terms of the GNU General Public License\r
+// as published by the Free Software Foundation; either version 2\r
+// of the License, or (at your option) any later version.\r
+\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software Foundation,\r
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\r
+//\r
+#include "StdAfx.h"\r
+#include "SVNRebaseCommand.h"\r
+\r
+#include "SysProgressDlg.h"\r
+#include "ProgressDlg.h"\r
+#include "MessageBox.h"\r
+#include "RenameDlg.h"\r
+#include "Git.h"\r
+#include "ShellUpdater.h"\r
+\r
+bool SVNRebaseCommand::Execute()\r
+{\r
+       return true;\r
+}\r
diff --git a/src/TortoiseProc/Commands/SVNRebaseCommand.h b/src/TortoiseProc/Commands/SVNRebaseCommand.h
new file mode 100644 (file)
index 0000000..cec001a
--- /dev/null
@@ -0,0 +1,35 @@
+// TortoiseGit - a Windows shell extension for easy version control\r
+\r
+// Copyright (C) 2007 - TortoiseGit\r
+\r
+// This program is free software; you can redistribute it and/or\r
+// modify it under the terms of the GNU General Public License\r
+// as published by the Free Software Foundation; either version 2\r
+// of the License, or (at your option) any later version.\r
+\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software Foundation,\r
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\r
+//\r
+#pragma once\r
+#include "Command.h"\r
+\r
+/**\r
+ * \ingroup TortoiseProc\r
+ * Copies dropped items.\r
+ */\r
+class SVNRebaseCommand : public Command\r
+{\r
+public:\r
+       /**\r
+        * Executes the command.\r
+        */\r
+       virtual bool                    Execute();\r
+};\r
+\r
+\r
index 6dc63f4..6dbe9fe 100644 (file)
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\Resources\copy.ico"\r
+                               RelativePath=".\copy.ico"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath=".\copy.ico"\r
+                               RelativePath="..\Resources\copy.ico"\r
                                >\r
                        </File>\r
                        <File\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath=".\explorer.ico"\r
+                               RelativePath="..\Resources\explorer.ico"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\Resources\explorer.ico"\r
+                               RelativePath=".\explorer.ico"\r
                                >\r
                        </File>\r
                        <File\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\Resources\newfolder.ico"\r
+                               RelativePath=".\newfolder.ico"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath=".\newfolder.ico"\r
+                               RelativePath="..\Resources\newfolder.ico"\r
                                >\r
                        </File>\r
                        <File\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\Resources\refresh.ico"\r
+                               RelativePath=".\refresh.ico"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath=".\refresh.ico"\r
+                               RelativePath="..\Resources\refresh.ico"\r
                                >\r
                        </File>\r
                        <File\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath=".\save.ico"\r
+                               RelativePath="..\Resources\save.ico"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\Resources\save.ico"\r
+                               RelativePath=".\save.ico"\r
                                >\r
                        </File>\r
                        <File\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\Resources\up.ico"\r
+                               RelativePath=".\up.ico"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath=".\up.ico"\r
+                               RelativePath="..\Resources\up.ico"\r
                                >\r
                        </File>\r
                        <File\r
                                        >\r
                                </File>\r
                        </Filter>\r
+                       <Filter\r
+                               Name="SVN"\r
+                               >\r
+                               <File\r
+                                       RelativePath=".\Commands\SVNDCommitCommand.cpp"\r
+                                       >\r
+                               </File>\r
+                               <File\r
+                                       RelativePath=".\Commands\SVNDCommitCommand.h"\r
+                                       >\r
+                               </File>\r
+                               <File\r
+                                       RelativePath=".\Commands\SVNRebaseCommand.cpp"\r
+                                       >\r
+                               </File>\r
+                               <File\r
+                                       RelativePath=".\Commands\SVNRebaseCommand.h"\r
+                                       >\r
+                               </File>\r
+                       </Filter>\r
                </Filter>\r
                <Filter\r
                        Name="Utility Dialogs"\r
index b48bd46..5f0806d 100644 (file)
Binary files a/src/TortoiseProc/resource.h and b/src/TortoiseProc/resource.h differ