• R/O
  • SSH
  • HTTPS

tortoisesvn: コミット


コミットメタ情報

リビジョン28977 (tree)
日時2020-09-26 03:22:21
作者stefankueng

ログメッセージ

rewrote reconstruction of wc paths from the file list in the log dialog. Don't show the menu "compare with working copy" if the reconstructed path does not exist.

変更サマリ

差分

--- trunk/src/TortoiseProc/LogDialog/LogDlg.cpp (revision 28976)
+++ trunk/src/TortoiseProc/LogDialog/LogDlg.cpp (revision 28977)
@@ -7185,19 +7185,32 @@
71857185 pCmi->fileUrl = sUrlRootUnescaped + pCmi->fileUrl.Trim();
71867186 if (m_hasWC)
71877187 {
7188- // firstfile = (e.g.) http://mydomain.com/repos/trunk/folder/file1
7189- // pCmi->sUrl = http://mydomain.com/repos/trunk/folder
7188+ // sUnescapedUrl = (e.g.) http://mydomain.com/repos/trunk/folder/file1
7189+ // pCmi->sUrl = (e.g.) http://mydomain.com/repos/trunk/folder
71907190 auto wcroot = GetWCRootFromPath(m_path);
71917191 auto wcrooturl = GetURLFromPath(wcroot);
71927192 CString sUnescapedUrl = CPathUtils::PathUnescape(wcrooturl);
7193- // find out until which char the urls are identical
7193+ std::wstring url1 = sUnescapedUrl;
7194+ std::wstring url2 = pCmi->fileUrl;
7195+ std::vector<std::wstring> vec1;
7196+ std::vector<std::wstring> vec2;
7197+ stringtok(vec1, url1, true, L"\\/");
7198+ stringtok(vec2, url2, true, L"\\/");
71947199 int i = 0;
7195- while ((i < pCmi->fileUrl.GetLength()) && (i < sUnescapedUrl.GetLength()) && (pCmi->fileUrl[i] == sUnescapedUrl[i]))
7196- i++;
7197- int leftcount = wcroot.GetWinPathString().GetLength() - (sUnescapedUrl.GetLength() - i);
7198- pCmi->wcPath = wcroot.GetWinPathString().Left(leftcount);
7199- pCmi->wcPath += pCmi->fileUrl.Mid(i);
7200+ while (i < vec1.size() && i < vec2.size() && vec1[i] == vec2[i])
7201+ ++i;
7202+
7203+ pCmi->wcPath = wcroot.GetWinPathString();
7204+ while (i < vec2.size())
7205+ {
7206+ pCmi->wcPath += L"\\";
7207+ pCmi->wcPath += vec2[i].c_str();
7208+ ++i;
7209+ }
7210+
72007211 pCmi->wcPath.Replace('/', '\\');
7212+ if (!PathFileExists(pCmi->wcPath))
7213+ pCmi->wcPath.Empty();
72017214 }
72027215 }
72037216
@@ -7220,7 +7233,7 @@
72207233 popup.AppendMenuIcon(ID_BLAMEDIFF, IDS_LOG_POPUP_BLAMEDIFF, IDI_BLAME);
72217234 popup.SetDefaultItem(ID_DIFF, FALSE);
72227235 popup.AppendMenuIcon(ID_GNUDIFF1, IDS_LOG_POPUP_GNUDIFF_CH, IDI_DIFF);
7223- if (m_hasWC)
7236+ if (m_hasWC && !pCmi->wcPath.IsEmpty())
72247237 {
72257238 popup.AppendMenuIcon(ID_COMPARE, IDS_LOG_POPUP_COMPARE, IDI_DIFF);
72267239 }
旧リポジトリブラウザで表示