浏览代码

更新前删除之前的日志;

Jeff 5 年之前
父节点
当前提交
b6a7744b50
共有 1 个文件被更改,包括 6 次插入3 次删除
  1. 6 3
      SATHelper/SATHelper/SVNProc.cpp

+ 6 - 3
SATHelper/SATHelper/SVNProc.cpp

@@ -51,11 +51,15 @@ void CSVNProc::Serialize(CArchive& ar)
 
 void CSVNProc::SVNProcess(std::string strSVNAddress, std::string strSavePath, DWORD dwSVNVersion, SVNTYPE type)
 {
+	TCHAR szFileName[MAX_PATH] = { 0 };
 	TCHAR szCommand[MAX_PATH] = { 0 };
+	// 删除之前的;
+	_stprintf_s(szFileName, _T("%ld"), m_svnpath);
+	DeleteFile(szFileName);
 	if ( type == SVN_EXPORT ) {
 		// 先删除要导出的路径;
 		_stprintf_s(szCommand, _T("/c rd /s /q %s"), strSavePath.c_str());
-		ShellExecute(NULL, _T("open"), _T("cmd"), szCommand, NULL, SW_HIDE);
+		ShellExecute(NULL, _T("open"), _T("cmd"), szCommand, NULL, SW_HIDE);	
 		// 再执行导出;
 		//_stprintf_s(szCommand, _T("/c svn export -r %d %s %s > data.jg &pause"), dwSVNVersion, strSVNAddress.c_str(), strSavePath.c_str());
 		_stprintf_s(szCommand, _T("/c svn export -r %d %s %s > %d"), dwSVNVersion, strSVNAddress.c_str(), strSavePath.c_str(), m_svnpath);
@@ -98,8 +102,7 @@ void CSVNProc::SVNProcess(std::string strSVNAddress, std::string strSavePath, DW
 	// 结束后进入文本结果识别;
 	CString str;
 	CStdioFile file;
-	_stprintf_s(szCommand, _T("%d"), m_svnpath);
-	if (file.Open(szCommand, CFile::modeRead)) {
+	if (file.Open(szFileName, CFile::modeRead)) {
 		// 文件大小;
 		ULONGLONG ulSize = file.SeekToEnd();
 		file.SeekToBegin();