本文整理汇总了C++中SVNRev::ToString方法的典型用法代码示例。如果您正苦于以下问题:C++ SVNRev::ToString方法的具体用法?C++ SVNRev::ToString怎么用?C++ SVNRev::ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SVNRev
的用法示例。
在下文中一共展示了SVNRev::ToString方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ShowUnifiedDiff
bool SVNDiff::ShowUnifiedDiff(const CTSVNPath& url1, const SVNRev& rev1,
const CTSVNPath& url2, const SVNRev& rev2,
SVNRev peg,
const CString& options,
bool bIgnoreAncestry /* = false */,
bool /*blame*/,
bool bIgnoreProperties /* = true */)
{
CTSVNPath tempfile;
if (UnifiedDiff(tempfile, url1, rev1, url2, rev2, peg, options, bIgnoreAncestry, bIgnoreProperties))
{
CString title;
CTSVNPathList list;
list.AddPath(url1);
list.AddPath(url2);
if (url1.IsEquivalentTo(url2))
title.FormatMessage(IDS_SVNDIFF_ONEURL, (LPCTSTR)rev1.ToString(), (LPCTSTR)rev2.ToString(), (LPCTSTR)url1.GetUIFileOrDirectoryName());
else
{
CTSVNPath root = list.GetCommonRoot();
CString u1 = url1.GetUIPathString().Mid(root.GetUIPathString().GetLength());
CString u2 = url2.GetUIPathString().Mid(root.GetUIPathString().GetLength());
title.FormatMessage(IDS_SVNDIFF_TWOURLS, (LPCTSTR)rev1.ToString(), (LPCTSTR)u1, (LPCTSTR)rev2.ToString(), (LPCTSTR)u2);
}
return !!CAppUtils::StartUnifiedDiffViewer(tempfile.GetWinPathString(), title);
}
return false;
}
示例2: SetEndRevision
void CMergeWizardTree::SetEndRevision(const SVNRev& rev)
{
if (rev.IsHead())
CheckRadioButton(IDC_REVISION_HEAD, IDC_REVISION_N, IDC_REVISION_HEAD);
else
{
CheckRadioButton(IDC_REVISION_HEAD, IDC_REVISION_N, IDC_REVISION_N);
m_sEndRev = rev.ToString();
UpdateData(FALSE);
}
}
示例3: SetRevision
void CSwitchDlg::SetRevision(const SVNRev& rev)
{
if (rev.IsHead())
CheckRadioButton(IDC_REVISION_HEAD, IDC_REVISION_N, IDC_REVISION_HEAD);
else
{
CheckRadioButton(IDC_REVISION_HEAD, IDC_REVISION_N, IDC_REVISION_N);
m_rev = rev.ToString();
UpdateData(FALSE);
}
}
示例4: PreUpdate
bool CHooks::PreUpdate(HWND hWnd, const CTSVNPathList& pathList, svn_depth_t depth, const SVNRev& rev, DWORD& exitcode, CString& error)
{
hookiterator it = FindItem(pre_update_hook, pathList);
if (it == end())
return false;
if (!ApproveHook(hWnd, it))
return false;
CString sCmd = it->second.commandline;
AddPathParam(sCmd, pathList);
AddDepthParam(sCmd, depth);
AddParam(sCmd, rev.ToString());
AddCWDParam(sCmd, pathList);
exitcode = RunScript(sCmd, pathList, error, it->second.bWait, it->second.bShow);
return true;
}
示例5: OnInitDialog
BOOL CEditPropExternalsValue::OnInitDialog()
{
CResizableStandAloneDialog::OnInitDialog();
CAppUtils::MarkWindowAsUnpinnable(m_hWnd);
BlockResize(DIALOG_BLOCKVERTICAL);
ExtendFrameIntoClientArea(IDC_GROUPBOTTOM);
m_aeroControls.SubclassOkCancelHelp(this);
m_sWCPath = m_External.targetDir;
SVNRev rev = m_External.revision;
SVNRev pegRev = SVNRev(m_External.pegrevision);
if ((pegRev.IsValid() && !pegRev.IsHead()) || (rev.IsValid() && !rev.IsHead()))
{
CheckRadioButton(IDC_REVISION_HEAD, IDC_REVISION_N, IDC_REVISION_N);
if (m_External.revision.value.number == m_External.pegrevision.value.number)
{
m_sPegRev = pegRev.ToString();
}
else
{
m_sRevision = rev.ToString();
m_sPegRev = pegRev.ToString();
}
}
else
{
CheckRadioButton(IDC_REVISION_HEAD, IDC_REVISION_N, IDC_REVISION_HEAD);
}
m_URLCombo.LoadHistory(L"Software\\TortoiseSVN\\History\\repoURLS", L"url");
m_URLCombo.SetURLHistory(true, false);
m_URLCombo.SetWindowText(CPathUtils::PathUnescape(m_External.url));
UpdateData(false);
CString sWindowTitle;
GetWindowText(sWindowTitle);
CAppUtils::SetWindowTitle(m_hWnd, m_pathList.GetCommonRoot().GetUIPathString(), sWindowTitle);
AddAnchor(IDC_WCLABEL, TOP_LEFT);
AddAnchor(IDC_WCPATH, TOP_LEFT, TOP_RIGHT);
AddAnchor(IDC_URLLABEL, TOP_LEFT);
AddAnchor(IDC_URLCOMBO, TOP_LEFT, TOP_RIGHT);
AddAnchor(IDC_BROWSE, TOP_RIGHT);
AddAnchor(IDC_PEGLABEL, TOP_LEFT);
AddAnchor(IDC_OPERATIVELABEL, TOP_LEFT);
AddAnchor(IDC_PEGREV, TOP_LEFT, TOP_RIGHT);
AddAnchor(IDC_GROUPBOTTOM, TOP_LEFT, TOP_RIGHT);
AddAnchor(IDC_REVISION_HEAD, TOP_LEFT);
AddAnchor(IDC_REVISION_N, TOP_LEFT);
AddAnchor(IDC_REVISION_NUM, TOP_LEFT, TOP_RIGHT);
AddAnchor(IDC_SHOW_LOG, TOP_RIGHT);
AddAnchor(IDOK, BOTTOM_RIGHT);
AddAnchor(IDCANCEL, BOTTOM_RIGHT);
AddAnchor(IDHELP, BOTTOM_RIGHT);
EnableSaveRestore(L"EditPropExternalsValue");
return TRUE;
}
示例6: DiffProps
//.........这里部分代码省略.........
n2.FormatMessage(IDS_DIFF_PROP_BASENAMEREV, basenameU.c_str(), baseRev);
else
n2.Format(IDS_DIFF_PROP_BASENAME, basenameU.c_str());
}
if (rev2.IsHead())
n2.Format(IDS_DIFF_PROP_REMOTENAME, basenameU.c_str());
if (n2.IsEmpty())
{
CString temp;
temp.Format(IDS_DIFF_REVISIONPATCHED, (LONG)rev2);
n2 = basenameU.c_str();
n2 += L" " + temp;
bSwitch = true;
}
else
{
n2 = CString(pathbuf1) + L" - " + n2;
}
if (bSwitch)
{
retvalue = !!CAppUtils::StartExtDiffProps(wcpropfile, basepropfile, n1, n2, TRUE, TRUE);
}
else
{
retvalue = !!CAppUtils::StartExtDiffProps(basepropfile, wcpropfile, n2, n1, TRUE, TRUE);
}
}
}
for (int wcindex = 0; wcindex < propswc.GetCount(); ++wcindex)
{
std::string wcname = propswc.GetItemName(wcindex);
tstring wcnameU = CUnicodeUtils::StdGetUnicode(wcname);
tstring wcvalue = (LPCTSTR)CUnicodeUtils::GetUnicode(propswc.GetItemValue(wcindex).c_str());
tstring basevalue;
bool bDiffRequired = true;
for (int baseindex = 0; baseindex < propsbase.GetCount(); ++baseindex)
{
if (propsbase.GetItemName(baseindex).compare(wcname)==0)
{
basevalue = CUnicodeUtils::GetUnicode(propsbase.GetItemValue(baseindex).c_str());
if (basevalue.compare(wcvalue)==0)
{
// name and value are identical
bDiffRequired = false;
break;
}
}
}
if (bDiffRequired)
{
// write both property values to temporary files
CTSVNPath wcpropfile = CTempFiles::Instance().GetTempFilePath(false);
CTSVNPath basepropfile = CTempFiles::Instance().GetTempFilePath(false);
FILE * pFile;
_tfopen_s(&pFile, wcpropfile.GetWinPath(), L"wb");
if (pFile)
{
fputs(CUnicodeUtils::StdGetUTF8(wcvalue).c_str(), pFile);
fclose(pFile);
FILE * pFile2;
_tfopen_s(&pFile2, basepropfile.GetWinPath(), L"wb");
if (pFile2)
{
fputs(CUnicodeUtils::StdGetUTF8(basevalue).c_str(), pFile2);
fclose(pFile2);
}
else
return false;
}
else
return false;
SetFileAttributes(wcpropfile.GetWinPath(), FILE_ATTRIBUTE_READONLY);
SetFileAttributes(basepropfile.GetWinPath(), FILE_ATTRIBUTE_READONLY);
CString n1, n2;
if (rev1.IsWorking())
n1.Format(IDS_DIFF_WCNAME, wcnameU.c_str());
if (rev1.IsBase())
n1.Format(IDS_DIFF_BASENAME, wcnameU.c_str());
if (rev1.IsHead())
n1.Format(IDS_DIFF_REMOTENAME, wcnameU.c_str());
if (n1.IsEmpty())
n1.FormatMessage(IDS_DIFF_PROP_REVISIONNAME, wcnameU.c_str(), (LPCTSTR)rev1.ToString());
else
n1 = CString(pathbuf1) + L" - " + n1;
if (rev2.IsWorking())
n2.Format(IDS_DIFF_WCNAME, wcnameU.c_str());
if (rev2.IsBase())
n2.Format(IDS_DIFF_BASENAME, wcnameU.c_str());
if (rev2.IsHead())
n2.Format(IDS_DIFF_REMOTENAME, wcnameU.c_str());
if (n2.IsEmpty())
n2.FormatMessage(IDS_DIFF_PROP_REVISIONNAME, wcnameU.c_str(), (LPCTSTR)rev2.ToString());
else
n2 = CString(pathbuf1) + L" - " + n2;
retvalue = !!CAppUtils::StartExtDiffProps(basepropfile, wcpropfile, n2, n1, TRUE, TRUE);
}
}
return retvalue;
}
示例7: ShowCompare
//.........这里部分代码省略.........
return !!CAppUtils::StartExtPatch(tempfile, url1.GetDirectory(), sWC, url2.GetSVNPathString(), TRUE);
}
}
else
{
progDlg.Stop();
m_pSVN->SetAndClearProgressInfo((HWND)NULL);
CFileDiffDlg fdlg;
fdlg.DoBlame(blame);
if (url1.IsEquivalentTo(url2))
{
fdlg.SetDiff(url1, (peg.IsValid() ? peg : m_headPeg), rev1, rev2, svn_depth_infinity, ignoreancestry);
fdlg.DoModal();
}
else
{
fdlg.SetDiff(url1, rev1, url2, rev2, svn_depth_infinity, ignoreancestry);
fdlg.DoModal();
}
}
}
else
{
if (url1.IsEquivalentTo(url2) && !ignoreprops)
{
svn_revnum_t baseRev = 0;
DiffProps(url1, rev2, rev1, baseRev);
}
// diffing two revs of a file, so export two files
CTSVNPath tempfile1 = CTempFiles::Instance().GetTempFilePath(m_bRemoveTempFiles, blame ? CTSVNPath() : url1, rev1);
CTSVNPath tempfile2 = CTempFiles::Instance().GetTempFilePath(m_bRemoveTempFiles, blame ? CTSVNPath() : url2, rev2);
m_pSVN->SetAndClearProgressInfo(&progDlg, true); // activate progress bar
progDlg.FormatPathLine(1, IDS_PROGRESSGETFILEREVISION, (LPCTSTR)url1.GetUIFileOrDirectoryName(), (LPCTSTR)rev1.ToString());
CAppUtils::GetMimeType(url1, mimetype, rev1);
CBlame blamer;
blamer.SetAndClearProgressInfo(&progDlg, true);
if (blame)
{
if (!blamer.BlameToFile(url1, 1, rev1, peg.IsValid() ? peg : rev1, tempfile1, options, TRUE, TRUE))
{
if ((peg.IsValid())&&(blamer.GetSVNError()->apr_err != SVN_ERR_CLIENT_IS_BINARY_FILE))
{
if (!blamer.BlameToFile(url1, 1, rev1, rev1, tempfile1, options, TRUE, TRUE))
{
progDlg.Stop();
m_pSVN->SetAndClearProgressInfo((HWND)NULL);
blamer.ShowErrorDialog(GetHWND());
return false;
}
}
else
{
if (blamer.GetSVNError()->apr_err != SVN_ERR_CLIENT_IS_BINARY_FILE)
{
progDlg.Stop();
m_pSVN->SetAndClearProgressInfo((HWND)NULL);
}
blamer.ShowErrorDialog(GetHWND());
if (blamer.GetSVNError()->apr_err == SVN_ERR_CLIENT_IS_BINARY_FILE)
blame = false;
else
return false;
}
}
}