本文整理汇总了C++中CTSVNPath函数的典型用法代码示例。如果您正苦于以下问题:C++ CTSVNPath函数的具体用法?C++ CTSVNPath怎么用?C++ CTSVNPath使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CTSVNPath函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CTSVNPath
void CRepositoryBrowserSelection::Add (const CItem* item)
{
if (item == NULL)
return;
// extract the info from the list item
SPath path;
CString absPath = item->absolutepath;
absPath.Replace (L"\\", L"%5C");
path.url = CTSVNPath (absPath);
// we don't fully escape the urls, because the GetSVNApiPath() method
// of the CTSVNPath already does escaping.
// We only escape special chars here:
// the '%' because we know that this char isn't escaped yet, and
// the '"' char, because we pass these urls to the command line as well
absPath.Replace (L"%", L"%25");
absPath.Replace (L"\"", L"%22");
path.urlEscaped = CTSVNPath (absPath);
path.isExternal = item->is_external;
path.isFolder = item->kind == svn_node_dir;
path.isLocked = !item->locktoken.IsEmpty();
// store & accumulate in the corresponding repository bucket
InternalAdd (item->repository, path);
}
示例2: AdminDirTest
void AdminDirTest()
{
CTSVNPath testPath;
testPath.SetFromUnknown(L"c:\\.svndir");
ATLASSERT(!testPath.IsAdminDir());
testPath.SetFromUnknown(L"c:\\test.svn");
ATLASSERT(!testPath.IsAdminDir());
testPath.SetFromUnknown(L"c:\\.svn");
ATLASSERT(testPath.IsAdminDir());
testPath.SetFromUnknown(L"c:\\.svndir\\test");
ATLASSERT(!testPath.IsAdminDir());
testPath.SetFromUnknown(L"c:\\.svn\\test");
ATLASSERT(testPath.IsAdminDir());
CTSVNPathList pathList;
pathList.AddPath(CTSVNPath(L"c:\\.svndir"));
pathList.AddPath(CTSVNPath(L"c:\\.svn"));
pathList.AddPath(CTSVNPath(L"c:\\.svn\\test"));
pathList.AddPath(CTSVNPath(L"c:\\test"));
pathList.RemoveAdminPaths();
ATLASSERT(pathList.GetCount()==2);
pathList.Clear();
pathList.AddPath(CTSVNPath(L"c:\\test"));
pathList.RemoveAdminPaths();
ATLASSERT(pathList.GetCount()==1);
}
示例3: lock
CTSVNPath CDirectoryWatcher::CloseInfoMap(HANDLE hDir)
{
AutoLocker lock(m_critSec);
auto d = watchInfoMap.find(hDir);
if (d != watchInfoMap.end())
{
CTSVNPath root = CTSVNPath(CTSVNPath(d->second->m_DirPath).GetRootPathString());
RemovePathAndChildren(root);
BlockPath(root);
}
CloseWatchHandles();
CTSVNPath path;
if (watchInfoMap.empty())
return path;
for (TInfoMap::iterator I = watchInfoMap.begin(); I != watchInfoMap.end(); ++I)
{
CDirectoryWatcher::CDirWatchInfo * info = I->second;
ScheduleForDeletion (info);
}
watchInfoMap.clear();
return path;
}
示例4: UpdateData
void CEditPropExternalsValue::OnBnClickedShowLog()
{
UpdateData(TRUE);
if (::IsWindow(m_pLogDlg->GetSafeHwnd())&&(m_pLogDlg->IsWindowVisible()))
return;
CString urlString = m_URLCombo.GetString();
CTSVNPath logUrl = m_URL;
if (urlString.GetLength()>1)
{
logUrl = CTSVNPath(SVNExternals::GetFullExternalUrl(urlString, m_RepoRoot.GetSVNPathString(), m_URL.GetSVNPathString()));
}
else
{
logUrl = m_RepoRoot;
logUrl.AppendPathString(urlString);
}
if (!logUrl.IsEmpty())
{
delete m_pLogDlg;
m_pLogDlg = new CLogDlg();
m_pLogDlg->SetSelect(true);
m_pLogDlg->m_pNotifyWindow = this;
m_pLogDlg->m_wParam = 0;
m_pLogDlg->SetParams(CTSVNPath(logUrl), SVNRev::REV_HEAD, SVNRev::REV_HEAD, 1, TRUE);
m_pLogDlg->ContinuousSelection(true);
m_pLogDlg->Create(IDD_LOGMESSAGE, this);
m_pLogDlg->ShowWindow(SW_SHOW);
}
AfxGetApp()->DoWaitCursor(-1);
}
示例5: AncestorTest
void AncestorTest()
{
CTSVNPath testPath;
testPath.SetFromWin(L"c:\\windows");
ATLASSERT(testPath.IsAncestorOf(CTSVNPath(L"c:\\"))==false);
ATLASSERT(testPath.IsAncestorOf(CTSVNPath(L"c:\\windows")));
ATLASSERT(testPath.IsAncestorOf(CTSVNPath(L"c:\\windowsdummy"))==false);
ATLASSERT(testPath.IsAncestorOf(CTSVNPath(L"c:\\windows\\test.txt")));
ATLASSERT(testPath.IsAncestorOf(CTSVNPath(L"c:\\windows\\system32\\test.txt")));
}
示例6: UpdateData
void CSetBugTraqAdv::OnOK()
{
UpdateData();
m_provider_clsid = GUID_NULL;
int index = m_cProviderCombo.GetCurSel();
if (index != CB_ERR)
{
CBugTraqProvider *provider = (CBugTraqProvider *)m_cProviderCombo.GetItemDataPtr(index);
m_provider_clsid = provider->clsid;
}
CComPtr<IBugTraqProvider> pProvider;
HRESULT hr = pProvider.CoCreateInstance(m_provider_clsid);
if (FAILED(hr))
{
m_tooltips.ShowBalloon(IDC_BUGTRAQPROVIDERCOMBO, IDS_ERR_MISSING_PROVIDER, IDS_ERR_ERROR, TTI_ERROR);
return;
}
VARIANT_BOOL valid;
ATL::CComBSTR parameters;
parameters.Attach(m_sParameters.AllocSysString());
hr = pProvider->ValidateParameters(GetSafeHwnd(), parameters, &valid);
if (FAILED(hr))
{
ShowEditBalloon(IDC_BUGTRAQPARAMETERS, IDS_ERR_PROVIDER_VALIDATE_FAILED, IDS_ERR_ERROR, TTI_ERROR);
return;
}
if (valid == VARIANT_FALSE)
return; // It's assumed that the provider will have done this.
if (m_pAssociations)
{
CBugTraqAssociation bugtraq_association;
if (m_pAssociations->FindProvider(CTSVNPathList(CTSVNPath(m_sPath)), &bugtraq_association))
{
if (bugtraq_association.GetPath().IsEquivalentToWithoutCase(CTSVNPath(m_sPath)))
{
ShowEditBalloon(IDC_BUGTRAQPATH, IDS_ERR_PROVIDER_PATH_ALREADY_CONFIGURED, IDS_ERR_ERROR, TTI_ERROR);
return;
}
}
}
CResizableStandAloneDialog::OnOK();
}
示例7: CheckData
void CMergeWizardTree::OnBnClickedFindbranchend()
{
CheckData(false);
if ((!EndRev.IsValid())||(EndRev == 0))
EndRev = SVNRev::REV_HEAD;
if (::IsWindow(m_pLogDlg2->GetSafeHwnd())&&(m_pLogDlg2->IsWindowVisible()))
return;
CString url;
m_URLCombo2.GetWindowText(url);
//now show the log dialog for the main trunk
if (!url.IsEmpty())
{
CTSVNPath wcPath = ((CMergeWizard*)GetParent())->wcPath;
if (m_pLogDlg2)
{
m_pLogDlg2->DestroyWindow();
delete m_pLogDlg2;
}
m_pLogDlg2 = new CLogDlg();
CRegDWORD reg = CRegDWORD(_T("Software\\TortoiseSVN\\NumberOfLogs"), 100);
int limit = (int)(LONG)reg;
m_pLogDlg2->m_wParam = MERGE_REVSELECTEND;
m_pLogDlg2->SetDialogTitle(CString(MAKEINTRESOURCE(IDS_MERGE_SELECTENDREVISION)));
m_pLogDlg2->SetSelect(true);
m_pLogDlg2->m_pNotifyWindow = this;
m_pLogDlg2->SetProjectPropertiesPath(wcPath);
m_pLogDlg2->SetParams(CTSVNPath(url), EndRev, EndRev, 1, limit, TRUE, FALSE);
m_pLogDlg2->ContinuousSelection(true);
m_pLogDlg2->SetMergePath(wcPath);
m_pLogDlg2->Create(IDD_LOGMESSAGE, this);
m_pLogDlg2->ShowWindow(SW_SHOW);
}
}
示例8: CLogDlg
void CMergeWizardReintegrate::OnBnClickedShowmergelog()
{
if (::IsWindow(m_pLogDlg->GetSafeHwnd())&&(m_pLogDlg->IsWindowVisible()))
return;
CString url;
m_URLCombo.GetWindowText(url);
if (!url.IsEmpty())
{
CTSVNPath wcPath = ((CMergeWizard*)GetParent())->wcPath;
if (m_pLogDlg)
m_pLogDlg->DestroyWindow();
delete m_pLogDlg;
m_pLogDlg = new CLogDlg();
CRegDWORD reg = CRegDWORD(_T("Software\\TortoiseSVN\\NumberOfLogs"), 100);
int limit = (int)(LONG)reg;
m_pLogDlg->SetDialogTitle(CString(MAKEINTRESOURCE(IDS_MERGE_SELECTRANGE)));
m_pLogDlg->SetSelect(true);
m_pLogDlg->m_pNotifyWindow = this;
m_pLogDlg->SetParams(CTSVNPath(url), SVNRev::REV_HEAD, SVNRev::REV_HEAD, 1, limit, TRUE, FALSE);
m_pLogDlg->SetProjectPropertiesPath(wcPath);
m_pLogDlg->SetMergePath(wcPath);
m_pLogDlg->Create(IDD_LOGMESSAGE, this);
m_pLogDlg->ShowWindow(SW_SHOW);
}
}
示例9: props
void CConflictResolveDlg::OnBnClickedUselocal()
{
bool bUseFull = !!m_pConflictDescription->is_binary;
bool diffallowed = ((m_pConflictDescription->merged_file && m_pConflictDescription->base_abspath)
|| (!m_pConflictDescription->base_abspath && m_pConflictDescription->my_abspath && m_pConflictDescription->their_abspath));
bUseFull = bUseFull || !diffallowed;
if (!bUseFull && m_pConflictDescription->local_abspath)
{
// try to get the mime-type property
// note:
// the is_binary member of the conflict description struct is currently
// always 'false' for merge conflicts. The svn library does not
// try to find out whether the text conflict is actually from a binary
// or a text file but passes 'false' unconditionally. So we try to
// find out for real whether the file is binary or not by reading
// the svn:mime-type property.
// If the svn lib ever changes that, we can remove this part of the code.
SVNProperties props(CTSVNPath(CUnicodeUtils::GetUnicode(m_pConflictDescription->local_abspath)), SVNRev::REV_WC, false, false);
for (int i = 0; i < props.GetCount(); ++i)
{
if (props.GetItemName(i).compare("svn:mime-type") == 0)
{
if (props.GetItemValue(i).find("text") == std::string::npos)
bUseFull = true;
}
}
}
m_choice = bUseFull ? svn_wc_conflict_choose_mine_full : svn_wc_conflict_choose_mine_conflict;
EndDialog(IDOK);
}
示例10: CString
void CEditPropExternals::OnBnClickedFindhead()
{
CProgressDlg progDlg;
progDlg.ShowModal(m_hWnd, TRUE);
progDlg.SetTitle(IDS_EDITPROPS_PROG_FINDHEADTITLE);
progDlg.SetLine(1, CString(MAKEINTRESOURCE(IDS_EDITPROPS_PROG_FINDHEADROOTS)));
DWORD count = 0;
DWORD total = (DWORD)m_externals.size()*4;
SVN svn;
svn.SetPromptParentWindow(m_hWnd);
SVNInfo svnInfo;
svnInfo.SetPromptParentWindow(m_hWnd);
for (auto it = m_externals.begin(); it != m_externals.end(); ++it)
{
progDlg.SetProgress(count++, total);
if (progDlg.HasUserCancelled())
break;
if (it->root.IsEmpty())
{
CTSVNPath p = it->path;
p.AppendPathString(it->targetDir);
it->root = svn.GetRepositoryRoot(p);
}
}
progDlg.SetLine(1, CString(MAKEINTRESOURCE(IDS_EDITPROPS_PROG_FINDHEADREVS)));
SVNLogHelper logHelper;
for (auto it = m_externals.begin(); it != m_externals.end(); ++it)
{
progDlg.SetProgress(count, total);
progDlg.SetLine(2, it->url, true);
if (progDlg.HasUserCancelled())
break;
count += 4;
if (!it->root.IsEmpty())
{
auto youngestRev = logHelper.GetYoungestRev(CTSVNPath(it->fullurl));
if (!youngestRev.IsValid())
it->headrev = svn.GetHEADRevision(CTSVNPath(it->fullurl), true);
else
it->headrev = youngestRev;
}
}
progDlg.Stop();
m_ExtList.Invalidate();
}
示例11: DWORD
CSVNStatusCache::CSVNStatusCache(void)
{
#define forever DWORD(-1)
AutoLocker lock(m_NoWatchPathCritSec);
TCHAR path[MAX_PATH];
SHGetFolderPath(NULL, CSIDL_COOKIES, NULL, 0, path);
m_NoWatchPaths[CTSVNPath(CString(path))] = forever;
SHGetFolderPath(NULL, CSIDL_HISTORY, NULL, 0, path);
m_NoWatchPaths[CTSVNPath(CString(path))] = forever;
SHGetFolderPath(NULL, CSIDL_INTERNET_CACHE, NULL, 0, path);
m_NoWatchPaths[CTSVNPath(CString(path))] = forever;
SHGetFolderPath(NULL, CSIDL_SYSTEM, NULL, 0, path);
m_NoWatchPaths[CTSVNPath(CString(path))] = forever;
SHGetFolderPath(NULL, CSIDL_WINDOWS, NULL, 0, path);
m_NoWatchPaths[CTSVNPath(CString(path))] = forever;
m_bClearMemory = false;
m_mostRecentExpiresAt = 0;
}
示例12: CTSVNPath
void CConflictResolveDlg::OnBnClickedEditconflict()
{
CString filename, n1, n2, n3, n4;
if (m_pConflictDescription->property_name)
{
filename = CUnicodeUtils::GetUnicode(m_pConflictDescription->property_name);
n1.Format(IDS_DIFF_PROP_WCNAME, (LPCTSTR)filename);
n2.Format(IDS_DIFF_PROP_BASENAME, (LPCTSTR)filename);
n3.Format(IDS_DIFF_PROP_REMOTENAME, (LPCTSTR)filename);
n4.Format(IDS_DIFF_PROP_MERGENAME, (LPCTSTR)filename);
}
else
{
filename = CUnicodeUtils::GetUnicode(m_pConflictDescription->local_abspath);
filename = CPathUtils::GetFileNameFromPath(filename);
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);
}
m_mergedfile = CTempFiles::Instance().GetTempFilePath(false, CTSVNPath(CUnicodeUtils::GetUnicode(m_pConflictDescription->local_abspath))).GetWinPath();
CAppUtils::MergeFlags flags;
flags.bAlternativeTool = (GetKeyState(VK_SHIFT)&0x8000) != 0;
flags.bReadOnly = true;
CTSVNPath basefile;
CTSVNPath theirfile;
CTSVNPath myfile;
if (m_pConflictDescription->base_abspath)
basefile = CTSVNPath(CUnicodeUtils::GetUnicode(m_pConflictDescription->base_abspath));
else
basefile = CTempFiles::Instance().GetTempFilePath(true);
if (m_pConflictDescription->their_abspath && (m_pConflictDescription->kind != svn_wc_conflict_kind_property))
theirfile = CTSVNPath(CUnicodeUtils::GetUnicode(m_pConflictDescription->their_abspath));
else
{
if (m_pConflictDescription->merged_file)
theirfile = CTSVNPath(CUnicodeUtils::GetUnicode(m_pConflictDescription->merged_file));
else
theirfile = CTempFiles::Instance().GetTempFilePath(true);
}
if (m_pConflictDescription->my_abspath)
myfile = CTSVNPath(CUnicodeUtils::GetUnicode(m_pConflictDescription->my_abspath));
else
{
if (m_pConflictDescription->merged_file)
myfile = CTSVNPath(CUnicodeUtils::GetUnicode(m_pConflictDescription->merged_file));
else
myfile = CTempFiles::Instance().GetTempFilePath(true);
}
CAppUtils::StartExtMerge(flags,
basefile,
theirfile,
myfile,
CTSVNPath(m_mergedfile), true,
n2, n3, n1, n4, filename);
GetDlgItem(IDC_RESOLVED)->EnableWindow(TRUE);
}
示例13: RemoveDuplicatesTest
void RemoveDuplicatesTest()
{
CTSVNPathList list;
list.AddPath(CTSVNPath(L"Z"));
list.AddPath(CTSVNPath(L"A"));
list.AddPath(CTSVNPath(L"E"));
list.AddPath(CTSVNPath(L"E"));
ATLASSERT(list[2].IsEquivalentTo(list[3]));
ATLASSERT(list[2]==list[3]);
ATLASSERT(list.GetCount() == 4);
list.RemoveDuplicates();
ATLASSERT(list.GetCount() == 3);
ATLASSERT(list[0].GetWinPathString() == L"A");
ATLASSERT(list[1].GetWinPathString().Compare(L"E") == 0);
ATLASSERT(list[2].GetWinPathString() == L"Z");
}
示例14: DWORD
CSVNStatusCache::CSVNStatusCache(void)
{
#define forever DWORD(-1)
AutoLocker lock(m_NoWatchPathCritSec);
m_NoWatchPaths[CTSVNPath(GetSpecialFolder(FOLDERID_Cookies))] = forever;
m_NoWatchPaths[CTSVNPath(GetSpecialFolder(FOLDERID_History))] = forever;
m_NoWatchPaths[CTSVNPath(GetSpecialFolder(FOLDERID_InternetCache))] = forever;
m_NoWatchPaths[CTSVNPath(GetSpecialFolder(FOLDERID_Windows))] = forever;
m_NoWatchPaths[CTSVNPath(GetSpecialFolder(FOLDERID_CDBurning))] = forever;
m_NoWatchPaths[CTSVNPath(GetSpecialFolder(FOLDERID_Fonts))] = forever;
m_NoWatchPaths[CTSVNPath(GetSpecialFolder(FOLDERID_RecycleBinFolder))] = forever;
m_NoWatchPaths[CTSVNPath(GetSpecialFolder(FOLDERID_SearchHistory))] = forever;
m_bClearMemory = false;
m_mostRecentExpiresAt = 0;
}
示例15: CTSVNPath
CTSVNPath CTSVNPathList::GetCommonRoot() const
{
if (GetCount() == 0)
return CTSVNPath();
if (GetCount() == 1)
return m_paths[0];
// first entry is common root for itself
// (add trailing '\\' to detect partial matches of the last path element)
CString root = m_paths[0].GetWinPathString() + '\\';
int rootLength = root.GetLength();
// determine common path string prefix
for ( PathVector::const_iterator it = m_paths.begin()+1
; it != m_paths.end()
; ++it)
{
CString path = it->GetWinPathString() + '\\';
int newLength = CStringUtils::GetMatchingLength (root, path);
if (newLength != rootLength)
{
root.Delete (newLength, rootLength);
rootLength = newLength;
}
}
// remove the last (partial) path element
if (rootLength > 0)
root.Delete (root.ReverseFind ('\\'), rootLength);
// done
return CTSVNPath (root);
}