本文整理汇总了C++中SVN::ShowErrorDialog方法的典型用法代码示例。如果您正苦于以下问题:C++ SVN::ShowErrorDialog方法的具体用法?C++ SVN::ShowErrorDialog怎么用?C++ SVN::ShowErrorDialog使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SVN
的用法示例。
在下文中一共展示了SVN::ShowErrorDialog方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnButtonClicked
HRESULT CNewTreeConflictEditorDlg::OnButtonClicked(HWND hWnd, int id)
{
for (SVNConflictOptions::const_iterator it = m_options.begin(); it != m_options.end(); ++it)
{
svn_client_conflict_option_id_t optionId = (*it)->GetId();
if (optionId + 100 == id)
{
if (m_svn)
{
if (!m_svn->ResolveTreeConflict(*m_conflictInfo, *it->get()))
{
m_svn->ShowErrorDialog(hWnd);
return S_FALSE;
}
}
else
{
SVN svn;
if (!svn.ResolveTreeConflict(*m_conflictInfo, *it->get()))
{
svn.ShowErrorDialog(hWnd);
return S_FALSE;
}
}
m_choice = optionId;
return S_OK;
}
}
return S_OK;
}
示例2: OnButtonClicked
HRESULT CTextConflictEditorDlg::OnButtonClicked(HWND hWnd, int id)
{
if (id == 1000)
{
// Edit conflicts
CTSVNPath theirs, mine, base;
m_merged = m_conflictInfo->GetPath();
m_conflictInfo->GetTextContentFiles(base, theirs, mine);
m_mergedCreationTime = m_merged.GetLastWriteTime();
::SendMessage(hWnd, TDM_ENABLE_BUTTON, 100 + svn_client_conflict_option_merged_text, 0);
CString filename, n1, n2, n3, n4;
filename = m_merged.GetUIFileOrDirectoryName();
n1.Format(IDS_DIFF_WCNAME, (LPCTSTR)filename);
n2.Format(IDS_DIFF_BASENAME, (LPCTSTR)filename);
n3.Format(IDS_DIFF_REMOTENAME, (LPCTSTR)filename);
n4.Format(IDS_DIFF_MERGEDNAME, (LPCTSTR)filename);
CAppUtils::MergeFlags flags;
flags.AlternativeTool((GetKeyState(VK_SHIFT) & 0x8000) != 0);
flags.PreventSVNResolve(true);
CAppUtils::StartExtMerge(flags,
base, theirs, mine, m_merged, true, n1, n1, n3, n4, filename);
return S_FALSE;
}
for (SVNConflictOptions::const_iterator it = m_options.begin(); it != m_options.end(); ++it)
{
svn_client_conflict_option_id_t optionId = (*it)->GetId();
int buttonID = 100 + optionId;
if (buttonID == id)
{
if (m_svn)
{
if (!m_svn->ResolveTextConflict(*m_conflictInfo, *it->get()))
{
m_svn->ShowErrorDialog(hWnd);
return S_FALSE;
}
}
else
{
SVN svn;
if (!svn.ResolveTextConflict(*m_conflictInfo, *it->get()))
{
svn.ShowErrorDialog(hWnd);
return S_FALSE;
}
}
m_choice = optionId;
return S_OK;
}
}
return S_OK;
}
示例3: RenameWithReplace
bool RenameCommand::RenameWithReplace(HWND hWnd, const CTSVNPathList &srcPathList,
const CTSVNPath &destPath,
const CString &message /* = L"" */,
bool move_as_child /* = false */,
bool make_parents /* = false */) const
{
SVN svn;
UINT idret = IDYES;
bool bRet = true;
if (destPath.Exists() && !destPath.IsDirectory() && !destPath.IsEquivalentToWithoutCase(srcPathList[0]))
{
CString sReplace;
sReplace.Format(IDS_PROC_REPLACEEXISTING, destPath.GetWinPath());
CTaskDialog taskdlg(sReplace,
CString(MAKEINTRESOURCE(IDS_PROC_REPLACEEXISTING_TASK2)),
L"TortoiseSVN",
0,
TDF_USE_COMMAND_LINKS | TDF_ALLOW_DIALOG_CANCELLATION | TDF_POSITION_RELATIVE_TO_WINDOW);
taskdlg.AddCommandControl(1, CString(MAKEINTRESOURCE(IDS_PROC_REPLACEEXISTING_TASK3)));
taskdlg.AddCommandControl(2, CString(MAKEINTRESOURCE(IDS_PROC_REPLACEEXISTING_TASK4)));
taskdlg.SetCommonButtons(TDCBF_CANCEL_BUTTON);
taskdlg.SetDefaultCommandControl(2);
taskdlg.SetMainIcon(TD_WARNING_ICON);
INT_PTR ret = taskdlg.DoModal(hWnd);
if (ret == 1) // replace
idret = IDYES;
else
idret = IDNO;
if (idret == IDYES)
{
if (!svn.Remove(CTSVNPathList(destPath), true, false))
{
destPath.Delete(true);
}
}
}
if ((idret != IDNO)&&(!svn.Move(srcPathList, destPath, message, move_as_child, make_parents)))
{
auto apr_err = svn.GetSVNError()->apr_err;
if ((apr_err == SVN_ERR_ENTRY_NOT_FOUND) || (apr_err == SVN_ERR_WC_PATH_NOT_FOUND))
{
bRet = !!MoveFile(srcPathList[0].GetWinPath(), destPath.GetWinPath());
}
else
{
svn.ShowErrorDialog(hWnd, srcPathList.GetCommonDirectory());
bRet = false;
}
}
if (idret == IDNO)
bRet = false;
return bRet;
}
示例4: Shelve
bool ShelveCommand::Shelve(const CString& shelveName, const CTSVNPathList& paths)
{
CProgressDlg progDlg;
progDlg.SetTitle(IDS_PROC_PATCHTITLE);
progDlg.SetShowProgressBar(false);
progDlg.ShowModeless(CWnd::FromHandle(GetExplorerHWND()));
CTSVNPath sDir = paths.GetCommonRoot();
SVN svn;
if (!svn.Shelve(shelveName, paths, svn_depth_infinity /*, changelists*/))
{
progDlg.Stop();
svn.ShowErrorDialog(GetExplorerHWND(), sDir);
return FALSE;
}
progDlg.Stop();
return TRUE;
}
示例5: OnBnClickedResolveusingtheirs
void CTreeConflictEditorDlg::OnBnClickedResolveusingtheirs()
{
int retVal = IDOK;
if (m_bInteractive)
{
m_choice = svn_wc_conflict_choose_merged;
EndDialog(retVal);
}
else
{
SVN svn;
if (!svn.Resolve(m_path, svn_wc_conflict_choose_merged, false, true, svn_wc_conflict_kind_tree))
{
svn.ShowErrorDialog(m_hWnd, m_path);
retVal = IDCANCEL;
}
else
m_choice = svn_wc_conflict_choose_merged;
EndDialog(retVal);
}
}
示例6: OnBnClickedCreatefolders
void CRepoCreationFinished::OnBnClickedCreatefolders()
{
// create the default folder structure in a temp folder
CTSVNPath tempDir = CTempFiles::Instance().GetTempDirPath(true);
if (tempDir.IsEmpty())
{
::MessageBox(m_hWnd, CString(MAKEINTRESOURCE(IDS_ERR_CREATETEMPDIR)), CString(MAKEINTRESOURCE(IDS_APPNAME)), MB_ICONERROR);
return;
}
CTSVNPath tempDirSub = tempDir;
tempDirSub.AppendPathString(L"trunk");
CreateDirectory(tempDirSub.GetWinPath(), NULL);
tempDirSub = tempDir;
tempDirSub.AppendPathString(L"branches");
CreateDirectory(tempDirSub.GetWinPath(), NULL);
tempDirSub = tempDir;
tempDirSub.AppendPathString(L"tags");
CreateDirectory(tempDirSub.GetWinPath(), NULL);
CString url;
if (m_RepoPath.GetWinPathString().GetAt(0) == '\\') // starts with '\' means an UNC path
{
CString p = m_RepoPath.GetWinPathString();
p.TrimLeft('\\');
url = L"file://"+p;
}
else
url = L"file:///"+m_RepoPath.GetWinPathString();
// import the folder structure into the new repository
SVN svn;
if (!svn.Import(tempDir, CTSVNPath(url), CString(MAKEINTRESOURCE(IDS_MSG_IMPORTEDSTRUCTURE)), NULL, svn_depth_infinity, true, true, false))
{
svn.ShowErrorDialog(m_hWnd);
return;
}
MessageBox(CString(MAKEINTRESOURCE(IDS_MSG_IMPORTEDSTRUCTUREFINISHED)), L"TortoiseSVN", MB_ICONINFORMATION);
DialogEnableWindow(IDC_CREATEFOLDERS, FALSE);
}
示例7: Execute
//.........这里部分代码省略.........
UINT msgRet = IDNO;
for(int nPath = 0; nPath < pathList.GetCount(); nPath++)
{
CTSVNPath destPath;
if (sNewName.IsEmpty())
destPath = CTSVNPath(droppath+_T("\\")+pathList[nPath].GetFileOrDirectoryName());
else
destPath = CTSVNPath(droppath+_T("\\")+sNewName);
// path the same but case-changed is ok: results in a case-rename
if (!(pathList[nPath].IsEquivalentToWithoutCase(destPath) && !pathList[nPath].IsEquivalentTo(destPath)))
{
if (destPath.Exists())
{
CString name = pathList[nPath].GetFileOrDirectoryName();
if (!sNewName.IsEmpty())
name = sNewName;
progress.Stop();
CRenameDlg dlg;
dlg.SetInputValidator(this);
dlg.m_name = name;
dlg.m_windowtitle.Format(IDS_PROC_NEWNAMEMOVE, (LPCTSTR)name);
if (dlg.DoModal() != IDOK)
{
return FALSE;
}
destPath.SetFromWin(droppath+_T("\\")+dlg.m_name);
}
}
if (!svn.Move(CTSVNPathList(pathList[nPath]), destPath))
{
if ((svn.GetSVNError() && svn.GetSVNError()->apr_err == SVN_ERR_ENTRY_EXISTS) && (destPath.Exists()))
{
if ((msgRet != IDYESTOALL) && (msgRet != IDNOTOALL))
{
// target file already exists. Ask user if he wants to replace the file
CString sReplace;
sReplace.Format(IDS_PROC_REPLACEEXISTING, destPath.GetWinPath());
if (CTaskDialog::IsSupported())
{
CTaskDialog taskdlg(sReplace,
CString(MAKEINTRESOURCE(IDS_PROC_REPLACEEXISTING_TASK2)),
L"TortoiseSVN",
0,
TDF_USE_COMMAND_LINKS|TDF_ALLOW_DIALOG_CANCELLATION|TDF_POSITION_RELATIVE_TO_WINDOW);
taskdlg.AddCommandControl(1, CString(MAKEINTRESOURCE(IDS_PROC_REPLACEEXISTING_TASK3)));
taskdlg.AddCommandControl(2, CString(MAKEINTRESOURCE(IDS_PROC_REPLACEEXISTING_TASK4)));
taskdlg.SetCommonButtons(TDCBF_CANCEL_BUTTON);
taskdlg.SetVerificationCheckboxText(CString(MAKEINTRESOURCE(IDS_PROC_REPLACEEXISTING_TASK5)));
taskdlg.SetVerificationCheckbox(false);
taskdlg.SetDefaultCommandControl(2);
taskdlg.SetMainIcon(TD_WARNING_ICON);
INT_PTR ret = taskdlg.DoModal(GetExplorerHWND());
if (ret == 1) // replace
msgRet = taskdlg.GetVerificationCheckboxState() ? IDYES : IDYESTOALL;
else
msgRet = taskdlg.GetVerificationCheckboxState() ? IDNO : IDNOTOALL;
}
else
{
msgRet = TSVNMessageBox(GetExplorerHWND(), sReplace, _T("TortoiseSVN"), MB_ICONQUESTION|MB_YESNO|MB_YESTOALL|MB_NOTOALL);
}
}
if ((msgRet == IDYES) || (msgRet == IDYESTOALL))
{
if (!svn.Remove(CTSVNPathList(destPath), true, false))
{
destPath.Delete(true);
}
if (!svn.Move(CTSVNPathList(pathList[nPath]), destPath))
{
svn.ShowErrorDialog(GetExplorerHWND(), pathList[nPath]);
return FALSE; //get out of here
}
CShellUpdater::Instance().AddPathForUpdate(destPath);
}
}
else
{
svn.ShowErrorDialog(GetExplorerHWND(), pathList[nPath]);
return FALSE; //get out of here
}
}
else
CShellUpdater::Instance().AddPathForUpdate(destPath);
count++;
if (progress.IsValid())
{
progress.FormatPathLine(1, IDS_PROC_MOVINGPROG, pathList[nPath].GetWinPath());
progress.FormatPathLine(2, IDS_PROC_CPYMVPROG2, destPath.GetWinPath());
progress.SetProgress(count, pathList.GetCount());
}
if ((progress.IsValid())&&(progress.HasUserCancelled()))
{
TSVNMessageBox(GetExplorerHWND(), IDS_SVN_USERCANCELLED, IDS_APPNAME, MB_ICONINFORMATION);
return FALSE;
}
}
return true;
}
示例8: Execute
bool PasteMoveCommand::Execute()
{
CString sDroppath = parser.GetVal(L"droptarget");
CTSVNPath dropPath(sDroppath);
ProjectProperties props;
props.ReadProps(dropPath);
if (dropPath.IsAdminDir())
return FALSE;
SVN svn;
SVNStatus status;
unsigned long count = 0;
pathList.RemoveAdminPaths();
CString sNewName;
CProgressDlg progress;
progress.SetTitle(IDS_PROC_MOVING);
progress.SetTime(true);
progress.ShowModeless(CWnd::FromHandle(GetExplorerHWND()));
for(int nPath = 0; nPath < pathList.GetCount(); nPath++)
{
CTSVNPath destPath;
if (sNewName.IsEmpty())
destPath = CTSVNPath(sDroppath+L"\\"+pathList[nPath].GetFileOrDirectoryName());
else
destPath = CTSVNPath(sDroppath+L"\\"+sNewName);
if (destPath.Exists())
{
CString name = pathList[nPath].GetFileOrDirectoryName();
if (!sNewName.IsEmpty())
name = sNewName;
progress.Stop();
CRenameDlg dlg;
dlg.SetFileSystemAutoComplete();
dlg.m_name = name;
dlg.SetInputValidator(this);
m_renPath = pathList[nPath];
dlg.m_windowtitle.Format(IDS_PROC_NEWNAMEMOVE, (LPCTSTR)name);
if (dlg.DoModal() != IDOK)
{
return FALSE;
}
destPath.SetFromWin(sDroppath+L"\\"+dlg.m_name);
}
svn_wc_status_kind s = status.GetAllStatus(pathList[nPath]);
if ((s == svn_wc_status_none)||(s == svn_wc_status_unversioned)||(s == svn_wc_status_ignored))
{
// source file is unversioned: move the file to the target, then add it
MoveFile(pathList[nPath].GetWinPath(), destPath.GetWinPath());
if (!svn.Add(CTSVNPathList(destPath), &props, svn_depth_infinity, true, true, false, true))
{
svn.ShowErrorDialog(GetExplorerHWND());
return FALSE; //get out of here
}
CShellUpdater::Instance().AddPathForUpdate(destPath);
}
else
{
if (!svn.Move(CTSVNPathList(pathList[nPath]), destPath))
{
svn.ShowErrorDialog(GetExplorerHWND());
return FALSE; //get out of here
}
else
CShellUpdater::Instance().AddPathForUpdate(destPath);
}
count++;
if (progress.IsValid())
{
progress.FormatPathLine(1, IDS_PROC_MOVINGPROG, pathList[nPath].GetWinPath());
progress.FormatPathLine(2, IDS_PROC_CPYMVPROG2, destPath.GetWinPath());
progress.SetProgress(count, pathList.GetCount());
}
if ((progress.IsValid())&&(progress.HasUserCancelled()))
{
TaskDialog(GetExplorerHWND(), AfxGetResourceHandle(), MAKEINTRESOURCE(IDS_APPNAME), MAKEINTRESOURCE(IDS_SVN_USERCANCELLED), NULL, TDCBF_OK_BUTTON, TD_INFORMATION_ICON, NULL);
return FALSE;
}
}
return true;
}
示例9: Execute
bool DropCopyCommand::Execute()
{
CString sDroppath = parser.GetVal(L"droptarget");
if (CTSVNPath(sDroppath).IsAdminDir())
return FALSE;
SVN svn;
unsigned long count = 0;
CString sNewName;
pathList.RemoveAdminPaths();
if ((parser.HasKey(L"rename"))&&(pathList.GetCount()==1))
{
// ask for a new name of the source item
CRenameDlg renDlg;
renDlg.SetInputValidator(this);
renDlg.SetFileSystemAutoComplete();
renDlg.m_windowtitle.LoadString(IDS_PROC_COPYRENAME);
renDlg.m_name = pathList[0].GetFileOrDirectoryName();
if (renDlg.DoModal() != IDOK)
{
return FALSE;
}
sNewName = renDlg.m_name;
}
CProgressDlg progress;
progress.SetTitle(IDS_PROC_COPYING);
progress.SetTime(true);
progress.ShowModeless(CWnd::FromHandle(GetExplorerHWND()));
UINT msgRet = IDNO;
INT_PTR msgRetNonversioned = 0;
for (int nPath = 0; nPath < pathList.GetCount(); nPath++)
{
const CTSVNPath& sourcePath = pathList[nPath];
CTSVNPath fullDropPath(sDroppath);
if (sNewName.IsEmpty())
fullDropPath.AppendPathString(sourcePath.GetFileOrDirectoryName());
else
fullDropPath.AppendPathString(sNewName);
// Check for a drop-on-to-ourselves
if (sourcePath.IsEquivalentTo(fullDropPath))
{
// Offer a rename
progress.Stop();
CRenameDlg dlg;
dlg.SetFileSystemAutoComplete();
dlg.m_windowtitle.Format(IDS_PROC_NEWNAMECOPY, (LPCTSTR)sourcePath.GetUIFileOrDirectoryName());
if (dlg.DoModal() != IDOK)
{
return FALSE;
}
// rebuild the progress dialog
progress.EnsureValid();
progress.SetTitle(IDS_PROC_COPYING);
progress.SetTime(true);
progress.SetProgress(count, pathList.GetCount());
progress.ShowModeless(CWnd::FromHandle(GetExplorerHWND()));
// Rebuild the destination path, with the new name
fullDropPath.SetFromUnknown(sDroppath);
fullDropPath.AppendPathString(dlg.m_name);
}
if (!svn.Copy(CTSVNPathList(sourcePath), fullDropPath, SVNRev::REV_WC, SVNRev()))
{
if ((svn.GetSVNError() && svn.GetSVNError()->apr_err == SVN_ERR_ENTRY_EXISTS) && (fullDropPath.Exists()))
{
if ((msgRet != IDYESTOALL) && (msgRet != IDNOTOALL))
{
// target file already exists. Ask user if he wants to replace the file
CString sReplace;
sReplace.Format(IDS_PROC_REPLACEEXISTING, fullDropPath.GetWinPath());
CTaskDialog taskdlg(sReplace,
CString(MAKEINTRESOURCE(IDS_PROC_REPLACEEXISTING_TASK2)),
L"TortoiseSVN",
0,
TDF_USE_COMMAND_LINKS | TDF_ALLOW_DIALOG_CANCELLATION | TDF_POSITION_RELATIVE_TO_WINDOW | TDF_SIZE_TO_CONTENT);
taskdlg.AddCommandControl(1, CString(MAKEINTRESOURCE(IDS_PROC_REPLACEEXISTING_TASK3)));
taskdlg.AddCommandControl(2, CString(MAKEINTRESOURCE(IDS_PROC_REPLACEEXISTING_TASK4)));
taskdlg.SetCommonButtons(TDCBF_CANCEL_BUTTON);
taskdlg.SetVerificationCheckboxText(CString(MAKEINTRESOURCE(IDS_PROC_REPLACEEXISTING_TASK5)));
taskdlg.SetVerificationCheckbox(false);
taskdlg.SetDefaultCommandControl(2);
taskdlg.SetMainIcon(TD_WARNING_ICON);
INT_PTR ret = taskdlg.DoModal(GetExplorerHWND());
if (ret == 1) // replace
msgRet = taskdlg.GetVerificationCheckboxState() ? IDYES : IDYESTOALL;
else
msgRet = taskdlg.GetVerificationCheckboxState() ? IDNO : IDNOTOALL;
}
if ((msgRet == IDYES) || (msgRet == IDYESTOALL))
{
if (!svn.Remove(CTSVNPathList(fullDropPath), true, false))
{
fullDropPath.Delete(true);
}
if (!svn.Copy(CTSVNPathList(pathList[nPath]), fullDropPath, SVNRev::REV_WC, SVNRev()))
{
svn.ShowErrorDialog(GetExplorerHWND(), pathList[nPath]);
return FALSE; //get out of here
}
//.........这里部分代码省略.........
示例10: Execute
bool RemoveCommand::Execute()
{
bool bRet = false;
// removing items from a working copy is done item-by-item so we
// have a chance to show a progress bar
//
// removing items from an URL in the repository requires that we
// ask the user for a log message.
SVN svn;
if ((pathList.GetCount())&&(SVN::PathIsURL(pathList[0])))
{
// Delete using URL's, not wc paths
svn.SetPromptApp(&theApp);
CInputLogDlg dlg;
CString sUUID;
svn.GetRepositoryRootAndUUID(pathList[0], true, sUUID);
dlg.SetUUID(sUUID);
CString sHint;
if (pathList.GetCount() == 1)
sHint.Format(IDS_INPUT_REMOVEONE, (LPCTSTR)pathList[0].GetSVNPathString());
else
sHint.Format(IDS_INPUT_REMOVEMORE, pathList.GetCount());
dlg.SetActionText(sHint);
if (dlg.DoModal()==IDOK)
{
if (!svn.Remove(pathList, true, !!parser.HasKey(L"keep"), dlg.GetLogMessage()))
{
svn.ShowErrorDialog(GetExplorerHWND(), pathList.GetCommonDirectory());
return false;
}
return true;
}
return false;
}
else
{
bool bForce = false;
for(int nPath = 0; nPath < pathList.GetCount(); nPath++)
{
CTraceToOutputDebugString::Instance()(_T(__FUNCTION__) L": remove file %s\n", (LPCTSTR)pathList[nPath].GetUIPathString());
// even though SVN::Remove takes a list of paths to delete at once
// we delete each item individually so we can prompt the user
// if something goes wrong or unversioned/modified items are
// to be deleted
CTSVNPathList removePathList(pathList[nPath]);
if ((bForce)&&(!parser.HasKey(L"keep")))
{
CTSVNPath delPath = removePathList[0];
if (!delPath.IsDirectory())
delPath.Delete(true);
// note: we don't move folders to the trash bin, so they can't
// get restored anymore - svn removes *all* files in a removed
// folder, even modified and unversioned ones
// We could move the folders here to the trash bin too, but then
// the folder would be gone and will require a recursive commit.
// Of course: a solution would be to first create a copy of the folder,
// move the original folder to the trash, then rename the copied folder
// to the original name, then let svn delete the folder - but
// that would just take too much time for bigger folders...
}
if (!svn.Remove(removePathList, bForce, !!parser.HasKey(L"keep")))
{
if ((svn.GetSVNError()->apr_err == SVN_ERR_UNVERSIONED_RESOURCE) ||
(svn.GetSVNError()->apr_err == SVN_ERR_CLIENT_MODIFIED))
{
UINT ret = 0;
CString msg;
if (pathList[nPath].IsDirectory())
msg.Format(IDS_PROC_REMOVEFORCE_TASK1_2, (LPCTSTR)svn.GetLastErrorMessage(0), (LPCTSTR)pathList[nPath].GetFileOrDirectoryName());
else
msg.Format(IDS_PROC_REMOVEFORCE_TASK1, (LPCTSTR)svn.GetLastErrorMessage(0), (LPCTSTR)pathList[nPath].GetFileOrDirectoryName());
CTaskDialog taskdlg(msg,
CString(MAKEINTRESOURCE(IDS_PROC_REMOVEFORCE_TASK2)),
L"TortoiseSVN",
0,
TDF_ENABLE_HYPERLINKS | TDF_USE_COMMAND_LINKS | TDF_ALLOW_DIALOG_CANCELLATION | TDF_POSITION_RELATIVE_TO_WINDOW);
taskdlg.AddCommandControl(IDYES, CString(MAKEINTRESOURCE(IDS_PROC_REMOVEFORCE_TASK3)));
taskdlg.AddCommandControl(IDNO, CString(MAKEINTRESOURCE(IDS_PROC_REMOVEFORCE_TASK4)));
taskdlg.SetCommonButtons(TDCBF_CANCEL_BUTTON);
taskdlg.SetVerificationCheckboxText(CString(MAKEINTRESOURCE(IDS_PROC_REMOVEFORCE_TASK5)));
taskdlg.SetDefaultCommandControl(IDNO);
taskdlg.SetMainIcon(TD_WARNING_ICON);
ret = (UINT)taskdlg.DoModal(GetExplorerHWND());
if (taskdlg.GetVerificationCheckboxState())
bForce = true;
if (ret == IDYESTOALL)
bForce = true;
if ((ret == IDYES)||(ret==IDYESTOALL))
{
if (!parser.HasKey(L"keep"))
{
CTSVNPath delPath = removePathList[0];
if (!delPath.IsDirectory())
delPath.Delete(true);
// note: see comment for the delPath.Delete() above
}
if (!svn.Remove(removePathList, true, !!parser.HasKey(L"keep")))
{
svn.ShowErrorDialog(GetExplorerHWND(), removePathList.GetCommonDirectory());
}
//.........这里部分代码省略.........
示例11: Execute
//.........这里部分代码省略.........
msg.Format(IDS_PROC_EXPORTUNVERSION, (LPCTSTR)droppath);
CTaskDialog taskdlg(msg,
CString(MAKEINTRESOURCE(IDS_PROC_EXPORTUNVERSION_TASK2)),
L"TortoiseSVN",
0,
TDF_ENABLE_HYPERLINKS | TDF_USE_COMMAND_LINKS | TDF_ALLOW_DIALOG_CANCELLATION | TDF_POSITION_RELATIVE_TO_WINDOW | TDF_SIZE_TO_CONTENT);
taskdlg.AddCommandControl(1, CString(MAKEINTRESOURCE(IDS_PROC_EXPORTUNVERSION_TASK3)));
taskdlg.AddCommandControl(2, CString(MAKEINTRESOURCE(IDS_PROC_EXPORTUNVERSION_TASK4)));
taskdlg.SetCommonButtons(TDCBF_CANCEL_BUTTON);
taskdlg.SetDefaultCommandControl(1);
taskdlg.SetMainIcon(TD_WARNING_ICON);
if (taskdlg.DoModal(GetExplorerHWND()) != 1)
return false;
CProgressDlg progress;
progress.SetTitle(IDS_PROC_UNVERSION);
progress.FormatNonPathLine(1, IDS_SVNPROGRESS_EXPORTINGWAIT);
progress.SetTime(true);
progress.ShowModeless(GetExplorerHWND());
std::vector<CTSVNPath> removeVector;
CDirFileEnum lister(droppath);
CString srcFile;
bool bFolder = false;
while (lister.NextFile(srcFile, &bFolder))
{
CTSVNPath item(srcFile);
if ((bFolder)&&(g_SVNAdminDir.IsAdminDirName(item.GetFileOrDirectoryName())))
{
removeVector.push_back(item);
}
}
DWORD count = 0;
for (std::vector<CTSVNPath>::iterator it = removeVector.begin(); (it != removeVector.end()) && (!progress.HasUserCancelled()); ++it)
{
progress.FormatPathLine(1, IDS_SVNPROGRESS_UNVERSION, (LPCTSTR)it->GetWinPath());
progress.SetProgress64(count, removeVector.size());
count++;
it->Delete(false);
}
progress.Stop();
}
else
{
bool bOverwrite = !!parser.HasKey(L"overwrite");
bool bAutorename = !!parser.HasKey(L"autorename");
UINT retDefault = bAutorename ? IDCUSTOM1 : 0;
for(int nPath = 0; nPath < pathList.GetCount(); nPath++)
{
CString dropper = droppath + L"\\" + pathList[nPath].GetFileOrDirectoryName();
if ((!bOverwrite)&&(PathFileExists(dropper)))
{
CString renameddropper;
renameddropper.FormatMessage(IDS_PROC_EXPORTFOLDERNAME, (LPCTSTR)droppath, (LPCTSTR)pathList[nPath].GetFileOrDirectoryName());
int exportcount = 1;
while (PathFileExists(renameddropper))
{
renameddropper.FormatMessage(IDS_PROC_EXPORTFOLDERNAME2, (LPCTSTR)droppath, (LPCTSTR)pathList[nPath].GetFileOrDirectoryName(), exportcount++);
}
UINT ret = retDefault;
if (ret == 0)
{
CString sMsg;
sMsg.Format(IDS_PROC_OVERWRITEEXPORT, (LPCTSTR)dropper);
CTaskDialog taskdlg(sMsg,
CString(MAKEINTRESOURCE(IDS_PROC_OVERWRITEEXPORT_TASK2)),
L"TortoiseSVN",
0,
TDF_ENABLE_HYPERLINKS | TDF_USE_COMMAND_LINKS | TDF_ALLOW_DIALOG_CANCELLATION | TDF_POSITION_RELATIVE_TO_WINDOW | TDF_SIZE_TO_CONTENT);
taskdlg.AddCommandControl(IDCUSTOM1, CString(MAKEINTRESOURCE(IDS_PROC_OVERWRITEEXPORT_TASK3)));
CString task4;
task4.Format(IDS_PROC_OVERWRITEEXPORT_TASK4, (LPCTSTR)renameddropper);
taskdlg.AddCommandControl(IDCUSTOM2, task4);
taskdlg.AddCommandControl(IDCUSTOM3, CString(MAKEINTRESOURCE(IDS_PROC_OVERWRITEEXPORT_TASK5)));
taskdlg.SetDefaultCommandControl(IDCUSTOM2);
taskdlg.SetCommonButtons(TDCBF_CANCEL_BUTTON);
taskdlg.SetVerificationCheckboxText(CString(MAKEINTRESOURCE(IDS_PROC_OVERWRITEEXPORT_TASK6)));
taskdlg.SetMainIcon(TD_WARNING_ICON);
ret = (UINT)taskdlg.DoModal(GetExplorerHWND());
if (taskdlg.GetVerificationCheckboxState())
retDefault = ret;
}
if (ret == IDCUSTOM3)
return false;
if (ret==IDCUSTOM2)
{
dropper = renameddropper;
}
}
if (!svn.Export(pathList[nPath], CTSVNPath(dropper), SVNRev::REV_WC ,SVNRev::REV_WC, !!parser.HasKey(L"overwrite"), false, false, svn_depth_infinity, GetExplorerHWND(), exportType))
{
svn.ShowErrorDialog(GetExplorerHWND(), pathList[nPath]);
bRet = false;
}
}
}
return bRet;
}
示例12: Execute
//.........这里部分代码省略.........
CString(MAKEINTRESOURCE(IDS_PROC_REPLACEEXISTING_TASK2)),
L"TortoiseSVN",
0,
TDF_USE_COMMAND_LINKS | TDF_ALLOW_DIALOG_CANCELLATION | TDF_POSITION_RELATIVE_TO_WINDOW | TDF_SIZE_TO_CONTENT);
taskdlg.AddCommandControl(1, CString(MAKEINTRESOURCE(IDS_PROC_REPLACEEXISTING_TASK3)));
taskdlg.AddCommandControl(2, CString(MAKEINTRESOURCE(IDS_PROC_REPLACEEXISTING_TASK4)));
taskdlg.SetCommonButtons(TDCBF_CANCEL_BUTTON);
taskdlg.SetVerificationCheckboxText(CString(MAKEINTRESOURCE(IDS_PROC_REPLACEEXISTING_TASK5)));
taskdlg.SetVerificationCheckbox(false);
taskdlg.SetDefaultCommandControl(2);
taskdlg.SetMainIcon(TD_WARNING_ICON);
INT_PTR ret = taskdlg.DoModal(GetExplorerHWND());
if (ret == 1) // replace
msgRet = taskdlg.GetVerificationCheckboxState() ? IDYESTOALL : IDYES;
else
msgRet = taskdlg.GetVerificationCheckboxState() ? IDNOTOALL : IDNO;
progress.EnsureValid();
progress.SetTitle(IDS_PROC_MOVING);
progress.SetTime(true);
progress.SetProgress(count, pathList.GetCount());
progress.ShowModeless(CWnd::FromHandle(GetExplorerHWND()));
}
if ((msgRet == IDYES) || (msgRet == IDYESTOALL))
{
if (!svn.Remove(CTSVNPathList(destPath), true, false))
{
destPath.Delete(true);
}
if (!svn.Move(CTSVNPathList(pathList[nPath]), destPath))
{
progress.Stop();
svn.ShowErrorDialog(GetExplorerHWND(), pathList[nPath]);
return FALSE; //get out of here
}
CShellUpdater::Instance().AddPathForUpdate(destPath);
}
}
else if (svn.GetSVNError() && svn.GetSVNError()->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
{
INT_PTR ret = 0;
if (msgRetNonversioned == 0)
{
progress.Stop();
CString sReplace;
sReplace.Format(IDS_PROC_MOVEUNVERSIONED_TASK1, destPath.GetWinPath());
CTaskDialog taskdlg(sReplace,
CString(MAKEINTRESOURCE(IDS_PROC_MOVEUNVERSIONED_TASK2)),
L"TortoiseSVN",
TDCBF_CANCEL_BUTTON,
TDF_USE_COMMAND_LINKS | TDF_ALLOW_DIALOG_CANCELLATION | TDF_POSITION_RELATIVE_TO_WINDOW | TDF_SIZE_TO_CONTENT);
taskdlg.AddCommandControl(101, CString(MAKEINTRESOURCE(IDS_PROC_MOVEUNVERSIONED_TASK3)));
taskdlg.AddCommandControl(102, CString(MAKEINTRESOURCE(IDS_PROC_MOVEUNVERSIONED_TASK4)));
taskdlg.AddCommandControl(103, CString(MAKEINTRESOURCE(IDS_PROC_MOVEUNVERSIONED_TASK5)));
taskdlg.SetVerificationCheckboxText(CString(MAKEINTRESOURCE(IDS_PROC_MOVEUNVERSIONED_TASK6)));
taskdlg.SetVerificationCheckbox(false);
taskdlg.SetDefaultCommandControl(103);
taskdlg.SetMainIcon(TD_WARNING_ICON);
ret = taskdlg.DoModal(GetExplorerHWND());
if (taskdlg.GetVerificationCheckboxState())
msgRetNonversioned = ret;
progress.EnsureValid();
progress.SetTitle(IDS_PROC_MOVING);