本文整理汇总了C++中SVN::CleanUp方法的典型用法代码示例。如果您正苦于以下问题:C++ SVN::CleanUp方法的具体用法?C++ SVN::CleanUp怎么用?C++ SVN::CleanUp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SVN
的用法示例。
在下文中一共展示了SVN::CleanUp方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Execute
//.........这里部分代码省略.........
{
if (token.Mid(0, 13) == _T("Would remove "))
{
CString tempPath = token.Mid(13).TrimRight();
if (quotepath)
{
tempPath = UnescapeQuotePath(tempPath.Trim(_T('"')));
}
if (i == 0)
delList.AddPath(CTGitPath(tempPath));
else
delList.AddPath(CTGitPath(submoduleList[i - 1] + "/" + tempPath));
}
token = cmdout.Tokenize(_T("\n"), pos);
}
if (sysProgressDlg.HasUserCancelled())
{
CMessageBox::Show(nullptr, IDS_SVN_USERCANCELLED, IDS_APPNAME, MB_OK);
return FALSE;
}
}
delList.DeleteAllFiles(true, false);
sysProgressDlg.Stop();
}
}
#if 0
CProgressDlg progress;
progress.SetTitle(IDS_PROC_CLEANUP);
progress.SetAnimation(IDR_CLEANUPANI);
progress.SetShowProgressBar(false);
progress.SetLine(1, CString(MAKEINTRESOURCE(IDS_PROC_CLEANUP_INFO1)));
progress.SetLine(2, CString(MAKEINTRESOURCE(IDS_PROC_CLEANUP_INFO2)));
progress.ShowModeless(hwndExplorer);
CString strSuccessfullPaths, strFailedPaths;
for (int i=0; i<pathList.GetCount(); ++i)
{
SVN svn;
if (!svn.CleanUp(pathList[i]))
{
strFailedPaths += _T("- ") + pathList[i].GetWinPathString() + _T("\n");
strFailedPaths += svn.GetLastErrorMessage() + _T("\n\n");
}
else
{
strSuccessfullPaths += _T("- ") + pathList[i].GetWinPathString() + _T("\n");
// after the cleanup has finished, crawl the path downwards and send a change
// notification for every directory to the shell. This will update the
// overlays in the left tree view of the explorer.
CDirFileEnum crawler(pathList[i].GetWinPathString());
CString sPath;
bool bDir = false;
CTSVNPathList updateList;
while (crawler.NextFile(sPath, &bDir))
{
if ((bDir) && (!g_SVNAdminDir.IsAdminDirPath(sPath)))
{
updateList.AddPath(CTSVNPath(sPath));
}
}
updateList.AddPath(pathList[i]);
CShellUpdater::Instance().AddPathsForUpdate(updateList);
CShellUpdater::Instance().Flush();
updateList.SortByPathname(true);
for (INT_PTR i=0; i<updateList.GetCount(); ++i)
{
SHChangeNotify(SHCNE_UPDATEITEM, SHCNF_PATH, updateList[i].GetWinPath(), NULL);
CTraceToOutputDebugString::Instance()(_T(__FUNCTION__) _T(": notify change for path %s\n"), updateList[i].GetWinPath());
}
}
}
progress.Stop();
CString strMessage;
if ( !strSuccessfullPaths.IsEmpty() )
{
CString tmp;
tmp.Format(IDS_PROC_CLEANUPFINISHED, (LPCTSTR)strSuccessfullPaths);
strMessage += tmp;
bRet = true;
}
if ( !strFailedPaths.IsEmpty() )
{
if (!strMessage.IsEmpty())
strMessage += _T("\n");
CString tmp;
tmp.Format(IDS_PROC_CLEANUPFINISHED_FAILED, (LPCTSTR)strFailedPaths);
strMessage += tmp;
bRet = false;
}
CMessageBox::Show(hwndExplorer, strMessage, _T("TortoiseGit"), MB_OK | (strFailedPaths.IsEmpty()?MB_ICONINFORMATION:MB_ICONERROR));
#endif
CShellUpdater::Instance().Flush();
return bRet;
}
示例2: Execute
//.........这里部分代码省略.........
int pos = 0;
CString token = cmdout.Tokenize(_T("\n"), pos);
CTGitPathList delList;
while (!token.IsEmpty())
{
if (token.Mid(0, 13) == _T("Would remove "))
{
CString tempPath = token.Mid(13).TrimRight();
if (quotepath)
{
tempPath = UnescapeQuotePath(tempPath.Trim(_T('"')));
}
delList.AddPath(CTGitPath(tempPath));
}
token = cmdout.Tokenize(_T("\n"), pos);
}
if (sysProgressDlg.HasUserCancelled())
{
CMessageBox::Show(NULL, IDS_SVN_USERCANCELLED, IDS_APPNAME, MB_OK);
return FALSE;
}
delList.DeleteAllFiles(true, false);
sysProgressDlg.Stop();
}
}
#if 0
CProgressDlg progress;
progress.SetTitle(IDS_PROC_CLEANUP);
progress.SetAnimation(IDR_CLEANUPANI);
progress.SetShowProgressBar(false);
progress.SetLine(1, CString(MAKEINTRESOURCE(IDS_PROC_CLEANUP_INFO1)));
progress.SetLine(2, CString(MAKEINTRESOURCE(IDS_PROC_CLEANUP_INFO2)));
progress.ShowModeless(hwndExplorer);
CString strSuccessfullPaths, strFailedPaths;
for (int i=0; i<pathList.GetCount(); ++i)
{
SVN svn;
if (!svn.CleanUp(pathList[i]))
{
strFailedPaths += _T("- ") + pathList[i].GetWinPathString() + _T("\n");
strFailedPaths += svn.GetLastErrorMessage() + _T("\n\n");
}
else
{
strSuccessfullPaths += _T("- ") + pathList[i].GetWinPathString() + _T("\n");
// after the cleanup has finished, crawl the path downwards and send a change
// notification for every directory to the shell. This will update the
// overlays in the left tree view of the explorer.
CDirFileEnum crawler(pathList[i].GetWinPathString());
CString sPath;
bool bDir = false;
CTSVNPathList updateList;
while (crawler.NextFile(sPath, &bDir))
{
if ((bDir) && (!g_SVNAdminDir.IsAdminDirPath(sPath)))
{
updateList.AddPath(CTSVNPath(sPath));
}
}
updateList.AddPath(pathList[i]);
CShellUpdater::Instance().AddPathsForUpdate(updateList);
CShellUpdater::Instance().Flush();
updateList.SortByPathname(true);
for (INT_PTR i=0; i<updateList.GetCount(); ++i)
{
SHChangeNotify(SHCNE_UPDATEITEM, SHCNF_PATH, updateList[i].GetWinPath(), NULL);
ATLTRACE(_T("notify change for path %s\n"), updateList[i].GetWinPath());
}
}
}
progress.Stop();
CString strMessage;
if ( !strSuccessfullPaths.IsEmpty() )
{
CString tmp;
tmp.Format(IDS_PROC_CLEANUPFINISHED, (LPCTSTR)strSuccessfullPaths);
strMessage += tmp;
bRet = true;
}
if ( !strFailedPaths.IsEmpty() )
{
if (!strMessage.IsEmpty())
strMessage += _T("\n");
CString tmp;
tmp.Format(IDS_PROC_CLEANUPFINISHED_FAILED, (LPCTSTR)strFailedPaths);
strMessage += tmp;
bRet = false;
}
CMessageBox::Show(hwndExplorer, strMessage, _T("TortoiseGit"), MB_OK | (strFailedPaths.IsEmpty()?MB_ICONINFORMATION:MB_ICONERROR));
#endif
CShellUpdater::Instance().Flush();
return bRet;
}