}\r
\r
char buffer[4096];\r
-int CGit::RunAsync(CString cmd,PROCESS_INFORMATION *piOut,HANDLE *hReadOut)\r
+int CGit::RunAsync(CString cmd,PROCESS_INFORMATION *piOut,HANDLE *hReadOut,CString *StdioFile)\r
{\r
SECURITY_ATTRIBUTES sa;\r
HANDLE hRead, hWrite;\r
+ HANDLE hStdioFile;\r
\r
sa.nLength = sizeof(SECURITY_ATTRIBUTES);\r
sa.lpSecurityDescriptor=NULL;\r
return GIT_ERROR_OPEN_PIP;\r
}\r
\r
+ if(StdioFile)\r
+ {\r
+ hStdioFile=CreateFile(*StdioFile,GENERIC_WRITE,FILE_SHARE_READ | FILE_SHARE_WRITE, \r
+ &sa,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL); \r
+ }\r
+\r
STARTUPINFO si;\r
PROCESS_INFORMATION pi;\r
si.cb=sizeof(STARTUPINFO);\r
GetStartupInfo(&si);\r
\r
si.hStdError=hWrite;\r
- si.hStdOutput=hWrite;\r
+ if(StdioFile)\r
+ si.hStdOutput=hStdioFile;\r
+ else\r
+ si.hStdOutput=hWrite;\r
+\r
si.wShowWindow=SW_HIDE;\r
si.dwFlags=STARTF_USESTDHANDLES|STARTF_USESHOWWINDOW;\r
\r
CGit(void);\r
~CGit(void);\r
int Run(CString cmd, CString* output);\r
- int RunAsync(CString cmd,PROCESS_INFORMATION *pi, HANDLE* hRead);\r
+ int RunAsync(CString cmd,PROCESS_INFORMATION *pi, HANDLE* hRead, CString *StdioFile=NULL);\r
int RunLogFile(CString cmd, CString &filename);\r
CString GetUserName(void);\r
CString GetUserEmail(void);\r
if (dlg.DoModal() == IDOK)\r
{\r
CString cmd;\r
- cmd.Format(_T("git.exe archive --format=zip %s"),\r
+ cmd.Format(_T("git.exe archive --format=zip --verbose %s"),\r
dlg.m_VersionName);\r
\r
- g_Git.RunLogFile(cmd,dlg.m_strExportDirectory);\r
- //CProgressDlg pro;\r
- //pro.m_GitCmd=cmd;\r
- //pro.DoModal();\r
+ //g_Git.RunLogFile(cmd,dlg.m_strExportDirectory);\r
+ CProgressDlg pro;\r
+ pro.m_GitCmd=cmd;\r
+ pro.m_LogFile=dlg.m_strExportDirectory;\r
+ pro.DoModal();\r
return TRUE;\r
}\r
return bRet;\r
\r
m_Animate.Play(0,-1,-1);\r
\r
- g_Git.RunAsync(this->m_GitCmd,&pi, &hRead);\r
+ CString *pfilename;\r
+ if(m_LogFile.IsEmpty())\r
+ pfilename=NULL;\r
+ else\r
+ pfilename=&m_LogFile;\r
+\r
+ g_Git.RunAsync(this->m_GitCmd,&pi, &hRead,pfilename);\r
this->DialogEnableWindow(IDOK,FALSE);\r
\r
DWORD readnumber;\r
text+=_T("\r\n")+m_LogText;\r
m_Log.SetWindowTextW(text);\r
\r
+ m_Log.LineScroll(m_Log.GetLineCount());\r
+\r
int s1=m_LogText.Find(_T(':'));\r
int s2=m_LogText.Find(_T('%'));\r
if(s1>0 && s2>0)\r
// Dialog Data\r
enum { IDD = IDD_GITPROGRESS };\r
CString m_GitCmd;\r
+ CString m_LogFile;\r
+\r
CProgressCtrl m_Progress;\r
\r
CEdit m_Log;\r