OSDN Git Service

Fixed issue #115: Windows XP: Initial "Git Clone..." from SVN Repository doesn't...
authorFrank Li <lznuaa@gmail.com>
Mon, 13 Jul 2009 15:54:25 +0000 (23:54 +0800)
committerFrank Li <lznuaa@gmail.com>
Mon, 13 Jul 2009 15:54:25 +0000 (23:54 +0800)
Signed-off-by: Frank Li <lznuaa@gmail.com>
src/TortoiseProc/Commands/CloneCommand.cpp
src/TortoiseProc/Commands/SVNRebaseCommand.cpp
src/TortoiseProc/RebaseDlg.h
src/TortoiseProc/TortoiseProc.vcproj

index 890deb0..361748e 100644 (file)
@@ -60,41 +60,10 @@ bool CloneCommand::Execute()
                // Handle Git SVN-clone\r
                if(dlg.m_bSVN)\r
                {\r
-                       WIN32_FILE_ATTRIBUTE_DATA attribs;\r
-                       if(GetFileAttributesEx(dlg.m_Directory, GetFileExInfoStandard, &attribs))\r
-                       {\r
-                               if(!(attribs.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))\r
-                               {\r
-                                       CString errstr;\r
-                                       errstr.Format(_T("%s is not valid directory"),dlg.m_Directory);\r
-                                       CMessageBox::Show(NULL,errstr,_T("TortoiseGit"),MB_OK|MB_ICONERROR);\r
-                                       return FALSE;\r
-                               }\r
-                       }       \r
-                       else\r
-                       {\r
-                               DWORD err = GetLastError();\r
-                               if(err == ERROR_PATH_NOT_FOUND)\r
-                               {\r
-                                       if(!CAppUtils::CreateMultipleDirectory(dlg.m_Directory))\r
-                                       {\r
-                                               CString errstr;\r
-                                               errstr.Format(_T("Fail create dir: %s"),dlg.m_Directory);\r
-                                               CMessageBox::Show(NULL,errstr,_T("TortoiseGit"),MB_OK|MB_ICONERROR);\r
-                                               return FALSE;\r
-                                       }\r
 \r
-                               }\r
-                               else\r
-                               {\r
-                                       CMessageBox::Show(NULL,_T("Unknow ERROR"),_T("TortoiseGit"),MB_OK|MB_ICONERROR);\r
-                                       return FALSE;\r
-                               }\r
-                       }\r
-\r
-                       g_Git.m_CurrentDir=dlg.m_Directory;\r
-                       cmd.Format(_T("git.exe svn clone \"%s\" "),\r
-                                               url);\r
+                       //g_Git.m_CurrentDir=dlg.m_Directory;\r
+                       cmd.Format(_T("git.exe svn clone \"%s\"  \"%s\""),\r
+                               url,dlg.m_Directory);\r
 \r
                        if(dlg.m_bSVNTrunk)\r
                                cmd+=_T(" -T ")+dlg.m_strSVNTrunk;\r
index be3c9c1..0dcfc05 100644 (file)
 #include "RenameDlg.h"\r
 #include "Git.h"\r
 #include "ShellUpdater.h"\r
+#include "rebasedlg.h"\r
 \r
 bool SVNRebaseCommand::Execute()\r
 {\r
-       return true;\r
+       bool bRet =false;\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");\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
+       CRebaseDlg dlg;\r
+       \r
+       dlg.m_PreCmd=_T("git.exe fetch");\r
+       dlg.m_Upstream=_T("remotes/trunk");\r
+\r
+       if(dlg.DoModal() == IDOK)\r
+       {\r
+               bRet=true;\r
+       }\r
+       return bRet;\r
 }\r
index eb2ed75..1f2dfe9 100644 (file)
@@ -105,6 +105,8 @@ public:
     CStatic m_CtrlStatusText;\r
        CBalloon                        m_tooltips;\r
 \r
+       CString m_PreCmd;\r
+\r
     BOOL m_bPickAll;\r
     BOOL m_bSquashAll;\r
     BOOL m_bEditAll;\r
index 0659734..5dc37c5 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