本文整理汇总了C++中SVN::IsRepository方法的典型用法代码示例。如果您正苦于以下问题:C++ SVN::IsRepository方法的具体用法?C++ SVN::IsRepository怎么用?C++ SVN::IsRepository使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SVN
的用法示例。
在下文中一共展示了SVN::IsRepository方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Execute
bool RepositoryBrowserCommand::Execute()
{
CString url;
SVN svn;
if (!cmdLinePath.IsEmpty())
{
if (cmdLinePath.GetSVNPathString().Left(4).CompareNoCase(_T("svn:"))==0)
{
// If the path starts with "svn:" and there is another protocol
// found in the path (a "://" found after the "svn:") then
// remove "svn:" from the beginning of the path.
if (cmdLinePath.GetSVNPathString().Find(_T("://"), 4)>=0)
cmdLinePath.SetFromSVN(cmdLinePath.GetSVNPathString().Mid(4));
}
url = svn.GetURLFromPath(cmdLinePath);
if (url.IsEmpty())
{
if (SVN::PathIsURL(cmdLinePath))
url = cmdLinePath.GetSVNPathString();
else if (svn.IsRepository(cmdLinePath))
{
// The path points to a local repository.
// Add 'file:///' so the repository browser recognizes
// it as an URL to the local repository.
if (cmdLinePath.GetWinPathString().GetAt(0) == '\\') // starts with '\' means an UNC path
{
CString p = cmdLinePath.GetWinPathString();
p.TrimLeft('\\');
url = _T("file://")+p;
}
else
url = _T("file:///")+cmdLinePath.GetWinPathString();
url.Replace('\\', '/');
}
}
}
if (cmdLinePath.GetUIPathString().Left(7).CompareNoCase(_T("file://"))==0)
{
cmdLinePath.SetFromUnknown(cmdLinePath.GetUIPathString().Mid(7));
}
if (url.IsEmpty())
{
CURLDlg urldlg;
if (urldlg.DoModal() != IDOK)
{
return false;
}
url = urldlg.m_url;
cmdLinePath = CTSVNPath(url);
}
CString val = parser.GetVal(_T("rev"));
SVNRev rev(val);
CRepositoryBrowser dlg(url, rev);
if (!cmdLinePath.IsUrl())
dlg.m_ProjectProperties.ReadProps(cmdLinePath);
else
{
if (parser.HasVal(_T("projectpropertiespath")))
{
dlg.m_ProjectProperties.ReadProps(CTSVNPath(parser.GetVal(_T("projectpropertiespath"))));
}
}
if (parser.HasKey(L"sparse"))
{
if (SVN::PathIsURL(cmdLinePath))
dlg.SetSparseCheckoutMode(CTSVNPath());
else
dlg.SetSparseCheckoutMode(cmdLinePath);
}
dlg.m_path = cmdLinePath;
dlg.DoModal();
if (parser.HasVal(L"outfile"))
{
CString sText = dlg.GetPath();
sText += L"\n";
sText += dlg.GetRevision().ToString();
CStringUtils::WriteStringToTextFile(parser.GetVal(L"outfile"), (LPCTSTR)sText, true);
}
return true;
}