• R/O
  • SSH
  • HTTPS

tortoisesvn: Commit


Commit MetaInfo

Revision28584 (tree)
Time2019-06-12 02:48:23
Authorstefankueng

Log Message

Merged revision(s) r28582 from trunk:
* When asking to rename similar files make sure they would get renamed at all.

Change Summary

Incremental Difference

--- branches/1.10.x/src/TortoiseProc/Commands/RenameCommand.cpp (revision 28583)
+++ branches/1.10.x/src/TortoiseProc/Commands/RenameCommand.cpp (revision 28584)
@@ -1,6 +1,6 @@
1-// TortoiseSVN - a Windows shell extension for easy version control
1+// TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2007-2011, 2013-2015 - TortoiseSVN
3+// Copyright (C) 2007-2011, 2013-2015, 2019 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -166,35 +166,57 @@
166166 CString sNewFilename = sNewMask + sFilename.Mid(sFilemask.GetLength());
167167 sTemp.Format(L"\n%s -> %s", (LPCTSTR)sFilename, (LPCTSTR)sNewFilename);
168168 if (!renlist[i].IsEquivalentTo(cmdLinePath))
169- sRenList += sTemp;
170- renmap[renlist[i].GetWinPathString()] = renlist[i].GetContainingDirectory().GetWinPathString()+L"\\"+sNewFilename;
169+ {
170+ if (sFilename != sNewFilename)
171+ {
172+ sRenList += sTemp;
173+ renmap[renlist[i].GetWinPathString()] = renlist[i].GetContainingDirectory().GetWinPathString() + L"\\" + sNewFilename;
174+ }
175+ }
176+ else
177+ renmap[renlist[i].GetWinPathString()] = renlist[i].GetContainingDirectory().GetWinPathString() + L"\\" + sNewFilename;
171178 }
172- CString sRenameMultipleQuestion;
173- sRenameMultipleQuestion.Format(IDS_PROC_MULTIRENAME, (LPCTSTR)sRenList);
174- UINT idret = ::MessageBox(GetExplorerHWND(), sRenameMultipleQuestion, L"TortoiseSVN", MB_ICONQUESTION|MB_YESNOCANCEL);
175- if (idret == IDYES)
179+ if (!renmap.empty())
176180 {
177- CProgressDlg progress;
178- progress.SetTitle(IDS_PROC_MOVING);
179- progress.SetTime(true);
180- progress.ShowModeless(CWnd::FromHandle(GetExplorerHWND()));
181- DWORD count = 1;
182- for (std::map<CString, CString>::iterator it=renmap.begin(); it != renmap.end(); ++it)
181+ CString sRenameMultipleQuestion;
182+ sRenameMultipleQuestion.Format(IDS_PROC_MULTIRENAME, (LPCTSTR)sRenList);
183+ UINT idret = ::MessageBox(GetExplorerHWND(), sRenameMultipleQuestion, L"TortoiseSVN", MB_ICONQUESTION | MB_YESNOCANCEL);
184+ if (idret == IDYES)
183185 {
184- progress.FormatPathLine(1, IDS_PROC_MOVINGPROG, (LPCTSTR)it->first);
185- progress.FormatPathLine(2, IDS_PROC_CPYMVPROG2, (LPCTSTR)it->second);
186- progress.SetProgress64(count, renmap.size());
187- if (RenameWithReplace(GetExplorerHWND(), CTSVNPathList(CTSVNPath(it->first)), CTSVNPath(it->second), sMsg))
186+ CProgressDlg progress;
187+ progress.SetTitle(IDS_PROC_MOVING);
188+ progress.SetTime(true);
189+ progress.ShowModeless(CWnd::FromHandle(GetExplorerHWND()));
190+ DWORD count = 1;
191+ for (std::map<CString, CString>::iterator it = renmap.begin(); it != renmap.end(); ++it)
188192 {
193+ progress.FormatPathLine(1, IDS_PROC_MOVINGPROG, (LPCTSTR)it->first);
194+ progress.FormatPathLine(2, IDS_PROC_CPYMVPROG2, (LPCTSTR)it->second);
195+ progress.SetProgress64(count, renmap.size());
196+ if (RenameWithReplace(GetExplorerHWND(), CTSVNPathList(CTSVNPath(it->first)), CTSVNPath(it->second), sMsg))
197+ {
198+ bRet = true;
199+ CShellUpdater::Instance().AddPathForUpdate(CTSVNPath(it->second));
200+ }
201+ }
202+ progress.Stop();
203+ }
204+ else if (idret == IDNO)
205+ {
206+ // no, user wants to just rename the file he selected
207+ if (RenameWithReplace(GetExplorerHWND(), CTSVNPathList(cmdLinePath), destinationPath, sMsg))
208+ {
189209 bRet = true;
190- CShellUpdater::Instance().AddPathForUpdate(CTSVNPath(it->second));
210+ CShellUpdater::Instance().AddPathForUpdate(destinationPath);
191211 }
192212 }
193- progress.Stop();
213+ else if (idret == IDCANCEL)
214+ {
215+ // nothing
216+ }
194217 }
195- else if (idret == IDNO)
218+ else
196219 {
197- // no, user wants to just rename the file he selected
198220 if (RenameWithReplace(GetExplorerHWND(), CTSVNPathList(cmdLinePath), destinationPath, sMsg))
199221 {
200222 bRet = true;
@@ -201,10 +223,6 @@
201223 CShellUpdater::Instance().AddPathForUpdate(destinationPath);
202224 }
203225 }
204- else if (idret == IDCANCEL)
205- {
206- // nothing
207- }
208226 }
209227 }
210228 }
Show on old repository browser