> thank you for the update! I guess it should work now, but looking at the code first confused me a lot (comments added):
>
> CString url = svn.GetURLFromPath(svnPath); ##sets url from wc path
> CString destUrl;
> if (m_URL != _T(""))
> {
> destUrl = m_URL; ##presets destUrl from public destination variable m_Url
> }
> m_URLCombo.LoadHistory(_T("Software\\TortoiseSVN\\History\\repoPaths\\")+sUUID, _T("url"));
> m_URLCombo.SetCurSel(0);
> if (!url.IsEmpty())
> {
> CString relPath = destUrl.Mid(m_repoRoot.GetLength());
> relPath = CPathUtils::PathUnescape(relPath);
> relPath.Replace('\\', '/');
> m_URLCombo.AddString(relPath, 0);
> m_URLCombo.SelectString(-1, relPath);
> m_URL = url; ## url now still contains source url from wc path and hereby resets m_URL - which just contained the destination. m_URL will anyway be updated when clicking the ok button, but I believe this line should better be changed
>
> SetDlgItemText(IDC_SRCURL, CTSVNPath(m_URL).GetUIPathString());
> SetDlgItemText(IDC_DESTURL, CTSVNPath(CPathUtils::CombineUrls(m_repoRoot, relPath)).GetUIPathString());
> }
>
>
> this would have been so much easier if I could have commited it myself... you could use this nicer version instead:
>
>
> CString url = svn.GetURLFromPath(svnPath);
> CString destUrl = url; ##added default variable assignment
> if (m_URL != _T(""))
> {
> destUrl = m_URL; ##presets destUrl from public destination variable m_Url
> }
> m_URLCombo.LoadHistory(_T("Software\\TortoiseSVN\\History\\repoPaths\\")+sUUID, _T("url"));
> m_URLCombo.SetCurSel(0);
> if (!url.IsEmpty())
> {
> CString relPath = destUrl.Mid(m_repoRoot.GetLength());
> relPath = CPathUtils::PathUnescape(relPath);
> relPath.Replace('\\', '/');
> m_URLCombo.AddString(relPath, 0);
> m_URLCombo.SelectString(-1, relPath);
> m_URL = destUrl;## used destUrl instead of url
>
> SetDlgItemText(IDC_SRCURL, CTSVNPath(m_URL).GetUIPathString());
> SetDlgItemText(IDC_DESTURL, CTSVNPath(CPathUtils::CombineUrls(m_repoRoot, relPath)).GetUIPathString());
> }
actually I now think that the default variable assignment must be used, otherwise destUrl will be empty, when not preset by a parameter! And I missed that the second last line should be
SetDlgItemText(IDC_SRCURL,CTSVNPath(url).GetUIPathString());
so in total:
CString url = svn.GetURLFromPath(svnPath);
CString destUrl = url; ##added default variable assignment
if (m_URL != _T(""))
{
destUrl = m_URL; ##presets destUrl from public destination variable m_Url
}
m_URLCombo.LoadHistory(_T("Software\\TortoiseSVN\\History\\repoPaths\\")+sUUID, _T("url"));
m_URLCombo.SetCurSel(0);
if (!url.IsEmpty())
{
CString relPath = destUrl.Mid(m_repoRoot.GetLength());
relPath = CPathUtils::PathUnescape(relPath);
relPath.Replace('\\', '/');
m_URLCombo.AddString(relPath, 0);
m_URLCombo.SelectString(-1, relPath);
m_URL = destUrl;## used destUrl instead of url
SetDlgItemText(IDC_SRCURL, CTSVNPath(url).GetUIPathString()); ##changed to url variable (source)
SetDlgItemText(IDC_DESTURL, CTSVNPath(CPathUtils::CombineUrls(m_repoRoot, relPath)).GetUIPathString());
}
------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=2928885
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2012-03-03 01:26:50 CET