• R/O
  • SSH
  • HTTPS

tortoisesvn: Commit


Commit MetaInfo

Revision4716 (tree)
Zeit2005-10-22 17:42:53
Autorstefankueng

Log Message

Merge revisions from trunk:

4484
4485
4489
4503
4504
4505
4506
4510
4511
4525
4527
4529
4531
4532
4540
4566
4587
4611
4612
4613
4614
4624
4625
4679
4699
4700

Ändern Zusammenfassung

Diff

--- branches/1.2.x/Languages/Tortoise.pot (revision 4715)
+++ branches/1.2.x/Languages/Tortoise.pot (revision 4716)
@@ -530,6 +530,10 @@
530530 msgid "Add '%s' to dictionary"
531531 msgstr ""
532532
533+#: ID:16,
534+msgid "Add (as replacement)..."
535+msgstr ""
536+
533537 #: ID:110,
534538 msgid "Add Extension Specific Diff Program"
535539 msgstr ""
--- branches/1.2.x/src/Changelog.txt (revision 4715)
+++ branches/1.2.x/src/Changelog.txt (revision 4716)
@@ -1,3 +1,8 @@
1+- BUG: The status cache didn't watch all required paths. (Stefan)
2+
3+Version 1.2.4
4+- BUG: TortoisePlink was unable to connect to svn+ssh. (Stefan)
5+
16 Version 1.2.3
27 - NEW: In the settings dialog, network page. A new button to edit the
38 Subversion servers file. (Stefan)
--- branches/1.2.x/src/SVN/SVNStatusListCtrl.cpp (revision 4715)
+++ branches/1.2.x/src/SVN/SVNStatusListCtrl.cpp (revision 4716)
@@ -1191,7 +1191,8 @@
11911191 int index;
11921192 while ((index = GetNextSelectedItem(pos)) >= 0)
11931193 {
1194- CheckEntry(index, nListItems);
1194+ if (index != pNMLV->iItem)
1195+ CheckEntry(index, nListItems);
11951196 }
11961197 }
11971198 }
@@ -1204,7 +1205,8 @@
12041205 int index;
12051206 while ((index = GetNextSelectedItem(pos)) >= 0)
12061207 {
1207- UncheckEntry(index, nListItems);
1208+ if (index != pNMLV->iItem)
1209+ UncheckEntry(index, nListItems);
12081210 }
12091211 }
12101212 }
--- branches/1.2.x/src/SVN/TSVNPath.cpp (revision 4715)
+++ branches/1.2.x/src/SVN/TSVNPath.cpp (revision 4716)
@@ -1002,6 +1002,9 @@
10021002 list.AddPath(CTSVNPath(_T("E")));
10031003 list.AddPath(CTSVNPath(_T("e")));
10041004
1005+ ATLASSERT(list[2].IsEquivalentTo(list[3]));
1006+ ATLASSERT(list[2]==list[3]);
1007+
10051008 ATLASSERT(list.GetCount() == 4);
10061009
10071010 list.RemoveDuplicates();
--- branches/1.2.x/src/SVN/TSVNPath.h (revision 4715)
+++ branches/1.2.x/src/SVN/TSVNPath.h (revision 4716)
@@ -136,6 +136,7 @@
136136 * Checks if two paths are equal. The slashes are taken care of.
137137 */
138138 bool IsEquivalentTo(const CTSVNPath& rhs) const;
139+ bool operator==(const CTSVNPath& x) const {return IsEquivalentTo(x);}
139140 /**
140141 * Checks if \c possibleDescendant is a child of this path.
141142 */
--- branches/1.2.x/src/TSVNCache/DirectoryWatcher.cpp (revision 4715)
+++ branches/1.2.x/src/TSVNCache/DirectoryWatcher.cpp (revision 4716)
@@ -149,11 +149,16 @@
149149 ATLTRACE("add path to watch %ws\n", newroot.GetWinPath());
150150 watchedPaths.AddPath(newroot);
151151 watchedPaths.RemoveChildren();
152+ CloseInfoMap();
153+ CloseHandle(m_hCompPort);
154+ m_hCompPort = INVALID_HANDLE_VALUE;
152155 return true;
153156 }
154157 ATLTRACE("add path to watch %ws\n", path.GetWinPath());
155158 watchedPaths.AddPath(path);
156- ClearInfoMap();
159+ CloseInfoMap();
160+ CloseHandle(m_hCompPort);
161+ m_hCompPort = INVALID_HANDLE_VALUE;
157162 return true;
158163 }
159164
@@ -186,8 +191,13 @@
186191 if (!m_bRunning)
187192 return;
188193 AutoLocker lock(m_critSec);
189- CloseHandle(m_hCompPort);
190194 ClearInfoMap();
195+ if (m_hCompPort != INVALID_HANDLE_VALUE)
196+ CloseHandle(m_hCompPort);
197+ // Since we pass m_hCompPort to CreateIoCompletionPort, we
198+ // have to set this to NULL to have that API create a new
199+ // handle.
200+ m_hCompPort = NULL;
191201 for (int i=0; i<watchedPaths.GetCount(); ++i)
192202 {
193203 HANDLE hDir = CreateFile(watchedPaths[i].GetWinPath(),
@@ -211,8 +221,10 @@
211221 if (m_hCompPort == NULL)
212222 {
213223 ATLTRACE("CDirectoryWatcher: CreateIoCompletionPort failed. Can't watch directory %ws\n", watchedPaths[i].GetWinPath());
224+ ClearInfoMap();
214225 CloseHandle(m_hCompPort);
215- pDirInfo->DeleteSelf();
226+ delete pDirInfo;
227+ pDirInfo = NULL;
216228 watchedPaths.RemovePath(watchedPaths[i]);
217229 break;
218230 }
@@ -226,8 +238,10 @@
226238 NULL)) //no completion routine!
227239 {
228240 ATLTRACE("CDirectoryWatcher: ReadDirectoryChangesW failed. Can't watch directory %ws\n", watchedPaths[i].GetWinPath());
241+ ClearInfoMap();
229242 CloseHandle(m_hCompPort);
230- pDirInfo->DeleteSelf();
243+ delete pDirInfo;
244+ pDirInfo = NULL;
231245 watchedPaths.RemovePath(watchedPaths[i]);
232246 break;
233247 }
@@ -240,7 +254,9 @@
240254 if (!m_bRunning)
241255 return;
242256 if (numBytes == 0)
243- break;
257+ {
258+ continue;
259+ }
244260 // NOTE: the longer this code takes to execute until ReadDirectoryChangesW
245261 // is called again, the higher the chance that we miss some
246262 // changes in the filesystem!
@@ -321,10 +337,20 @@
321337 {
322338 for (std::map<HANDLE, CDirWatchInfo *>::iterator I = watchInfoMap.begin(); I != watchInfoMap.end(); ++I)
323339 {
324- I->second->DeleteSelf();
340+ CDirectoryWatcher::CDirWatchInfo * info = I->second;
341+ delete info;
325342 }
326343 watchInfoMap.clear();
344+}
327345
346+void CDirectoryWatcher::CloseInfoMap()
347+{
348+ for (std::map<HANDLE, CDirWatchInfo *>::iterator I = watchInfoMap.begin(); I != watchInfoMap.end(); ++I)
349+ {
350+ CDirectoryWatcher::CDirWatchInfo * info = I->second;
351+ info->CloseDirectoryHandle();
352+ }
353+ watchInfoMap.clear();
328354 }
329355
330356 CDirectoryWatcher::CDirWatchInfo::CDirWatchInfo(HANDLE hDir, const CTSVNPath& DirectoryName) :
@@ -344,11 +370,6 @@
344370 CloseDirectoryHandle();
345371 }
346372
347-void CDirectoryWatcher::CDirWatchInfo::DeleteSelf()
348-{
349- delete this;
350-}
351-
352373 bool CDirectoryWatcher::CDirWatchInfo::CloseDirectoryHandle()
353374 {
354375 bool b = TRUE;
--- branches/1.2.x/src/TSVNCache/DirectoryWatcher.h (revision 4715)
+++ branches/1.2.x/src/TSVNCache/DirectoryWatcher.h (revision 4716)
@@ -73,6 +73,7 @@
7373 void WorkerThread();
7474
7575 void ClearInfoMap();
76+ void CloseInfoMap();
7677
7778 private:
7879 CComAutoCriticalSection m_critSec;
@@ -96,10 +97,7 @@
9697 CDirWatchInfo & operator=(const CDirWatchInfo & rhs);//so that they're aren't accidentally used. -- you'll get a linker error
9798 public:
9899 CDirWatchInfo(HANDLE hDir, const CTSVNPath& DirectoryName);
99- private:
100- ~CDirWatchInfo(); // only I can delete myself....use DeleteSelf()
101- public:
102- void DeleteSelf();
100+ ~CDirWatchInfo();
103101
104102 protected:
105103 public:
--- branches/1.2.x/src/TSVNCache/FolderCrawler.cpp (revision 4715)
+++ branches/1.2.x/src/TSVNCache/FolderCrawler.cpp (revision 4716)
@@ -38,17 +38,20 @@
3838
3939 void CFolderCrawler::Stop()
4040 {
41- SetEvent(m_hTerminationEvent);
42- if(WaitForSingleObject(m_hThread, 5000) != WAIT_OBJECT_0)
41+ if (m_hTerminationEvent != INVALID_HANDLE_VALUE)
4342 {
44- ATLTRACE("Error terminating crawler thread\n");
43+ SetEvent(m_hTerminationEvent);
44+ if(WaitForSingleObject(m_hThread, 5000) != WAIT_OBJECT_0)
45+ {
46+ ATLTRACE("Error terminating crawler thread\n");
47+ }
48+ CloseHandle(m_hThread);
49+ m_hThread = INVALID_HANDLE_VALUE;
50+ CloseHandle(m_hTerminationEvent);
51+ m_hTerminationEvent = INVALID_HANDLE_VALUE;
52+ CloseHandle(m_hWakeEvent);
53+ m_hWakeEvent = INVALID_HANDLE_VALUE;
4554 }
46- CloseHandle(m_hThread);
47- m_hThread = INVALID_HANDLE_VALUE;
48- CloseHandle(m_hTerminationEvent);
49- m_hTerminationEvent = INVALID_HANDLE_VALUE;
50- CloseHandle(m_hWakeEvent);
51- m_hWakeEvent = INVALID_HANDLE_VALUE;
5255 }
5356
5457 void CFolderCrawler::Initialise()
@@ -209,6 +212,11 @@
209212 CSVNStatusCache::Instance().RemoveCacheForPath(workingPath);
210213 }
211214 CSVNStatusCache::Instance().Done();
215+ //In case that svn_client_stat() modified a file and we got
216+ //a notification about that in the directory watcher,
217+ //remove that here again - this is to prevent an endless loop
218+ AutoLocker lock(m_critSec);
219+ m_pathsToUpdate.erase(std::remove(m_pathsToUpdate.begin(), m_pathsToUpdate.end(), workingPath), m_pathsToUpdate.end());
212220 }
213221 else if (workingPath.HasAdminDir())
214222 {
@@ -225,6 +233,8 @@
225233 CSVNStatusCache::Instance().GetDirectoryCacheEntry(workingPath)->Invalidate();
226234 CSVNStatusCache::Instance().GetStatusForPath(workingPath, flags);
227235 CSVNStatusCache::Instance().Done();
236+ AutoLocker lock(m_critSec);
237+ m_pathsToUpdate.erase(std::remove(m_pathsToUpdate.begin(), m_pathsToUpdate.end(), workingPath), m_pathsToUpdate.end());
228238 }
229239 }
230240 else if (!m_foldersToUpdate.empty())
--- branches/1.2.x/src/TSVNCache/ShellUpdater.cpp (revision 4715)
+++ branches/1.2.x/src/TSVNCache/ShellUpdater.cpp (revision 4716)
@@ -35,17 +35,20 @@
3535
3636 void CShellUpdater::Stop()
3737 {
38- SetEvent(m_hTerminationEvent);
39- if(WaitForSingleObject(m_hThread, 200) != WAIT_OBJECT_0)
38+ if (m_hTerminationEvent != INVALID_HANDLE_VALUE)
4039 {
41- ATLTRACE("Error terminating shellupdater thread\n");
40+ SetEvent(m_hTerminationEvent);
41+ if(WaitForSingleObject(m_hThread, 200) != WAIT_OBJECT_0)
42+ {
43+ ATLTRACE("Error terminating shellupdater thread\n");
44+ }
45+ CloseHandle(m_hThread);
46+ m_hThread = INVALID_HANDLE_VALUE;
47+ CloseHandle(m_hTerminationEvent);
48+ m_hTerminationEvent = INVALID_HANDLE_VALUE;
49+ CloseHandle(m_hWakeEvent);
50+ m_hWakeEvent = INVALID_HANDLE_VALUE;
4251 }
43- CloseHandle(m_hThread);
44- m_hThread = INVALID_HANDLE_VALUE;
45- CloseHandle(m_hTerminationEvent);
46- m_hTerminationEvent = INVALID_HANDLE_VALUE;
47- CloseHandle(m_hWakeEvent);
48- m_hWakeEvent = INVALID_HANDLE_VALUE;
4952 }
5053
5154 void CShellUpdater::Initialise()
--- branches/1.2.x/src/TSVNCache/TSVNCache.cpp (revision 4715)
+++ branches/1.2.x/src/TSVNCache/TSVNCache.cpp (revision 4716)
@@ -239,17 +239,14 @@
239239 while (bRun)
240240 {
241241 bLoopRet = GetMessage(&msg, NULL, 0, 0);
242- if (bLoopRet != -1)
242+ if ((bLoopRet != -1)&&(bLoopRet != 0))
243243 {
244244 DispatchMessage(&msg);
245245 }
246246 }
247247
248- CSVNStatusCache::Instance().WaitToWrite();
249- CSVNStatusCache::Instance().Stop();
250- Sleep(1500);
251- CSVNStatusCache::Instance().SaveCache();
252- ATLTRACE("WM_CLOSE/QUIT/DESTROY/ENDSESSION\n");
248+ bRun = false;
249+
253250 Shell_NotifyIcon(NIM_DELETE,&niData);
254251 CSVNStatusCache::Destroy();
255252 apr_terminate();
@@ -300,16 +297,19 @@
300297 }
301298 case WM_ENDSESSION:
302299 case WM_DESTROY:
300+ case WM_CLOSE:
303301 case WM_QUIT:
304- case WM_CLOSE:
305302 {
306- if (bRun)
307- {
308- bRun = false;
309- CSVNStatusCache::Instance().Stop();
310- PostMessage(hWnd, WM_QUIT, 0, 0);
311- }
303+ ATLTRACE("WM_CLOSE/DESTROY/ENDSESSION/QUIT\n");
304+ CSVNStatusCache::Instance().WaitToWrite();
305+ CSVNStatusCache::Instance().Stop();
306+ CSVNStatusCache::Instance().SaveCache();
307+ if (message != WM_QUIT)
308+ PostQuitMessage(0);
309+ bRun = false;
310+ return 1;
312311 }
312+ break;
313313 default:
314314 break;
315315 }
--- branches/1.2.x/src/TortoiseProc/AddDlg.cpp (revision 4715)
+++ branches/1.2.x/src/TortoiseProc/AddDlg.cpp (revision 4716)
@@ -128,7 +128,8 @@
128128 GetDlgItem(IDCANCEL)->EnableWindow(false);
129129
130130 m_addListCtrl.GetStatus(m_pathList);
131- m_addListCtrl.Show(SVNSLC_SHOWUNVERSIONED | SVNSLC_SHOWDIRECTFILES, SVNSLC_SHOWUNVERSIONED | SVNSLC_SHOWDIRECTFILES);
131+ m_addListCtrl.Show(SVNSLC_SHOWUNVERSIONED | SVNSLC_SHOWDIRECTFILES | SVNSLC_SHOWADDED,
132+ SVNSLC_SHOWUNVERSIONED | SVNSLC_SHOWDIRECTFILES | SVNSLC_SHOWADDED);
132133
133134 GetDlgItem(IDOK)->EnableWindow(true);
134135 GetDlgItem(IDCANCEL)->EnableWindow(true);
--- branches/1.2.x/src/TortoiseProc/LogDlg.cpp (revision 4715)
+++ branches/1.2.x/src/TortoiseProc/LogDlg.cpp (revision 4716)
@@ -254,8 +254,10 @@
254254 //blocking the dialog
255255 m_tTo = 0;
256256 m_tFrom = (DWORD)-1;
257+ m_bThreadRunning = TRUE;
257258 if (AfxBeginThread(LogThreadEntry, this)==NULL)
258259 {
260+ m_bThreadRunning = FALSE;
259261 CMessageBox::Show(NULL, IDS_ERR_THREADSTARTFAILED, IDS_APPNAME, MB_OK | MB_ICONERROR);
260262 }
261263 return FALSE;
@@ -370,8 +372,10 @@
370372 m_limit = 0;
371373 m_tTo = 0;
372374 m_tFrom = (DWORD)-1;
375+ m_bThreadRunning = TRUE;
373376 if (AfxBeginThread(LogThreadEntry, this)==NULL)
374377 {
378+ m_bThreadRunning = FALSE;
375379 CMessageBox::Show(NULL, IDS_ERR_THREADSTARTFAILED, IDS_APPNAME, MB_OK | MB_ICONERROR);
376380 }
377381 GetDlgItem(IDC_LOGLIST)->UpdateData(FALSE);
@@ -401,8 +405,10 @@
401405 m_bCancelled = FALSE;
402406 m_limit = 100;
403407 SetSortArrow(&m_LogList, -1, true);
408+ m_bThreadRunning = TRUE;
404409 if (AfxBeginThread(LogThreadEntry, this)==NULL)
405410 {
411+ m_bThreadRunning = FALSE;
406412 CMessageBox::Show(NULL, IDS_ERR_THREADSTARTFAILED, IDS_APPNAME, MB_OK | MB_ICONERROR);
407413 }
408414 GetDlgItem(IDC_LOGLIST)->UpdateData(FALSE);
@@ -418,7 +424,7 @@
418424 CString temp, temp2;
419425 GetDlgItem(IDOK)->GetWindowText(temp);
420426 temp2.LoadString(IDS_MSGBOX_CANCEL);
421- if (temp.Compare(temp2)==0)
427+ if ((temp.Compare(temp2)==0)||(m_bThreadRunning))
422428 {
423429 m_bCancelled = TRUE;
424430 return;
@@ -577,9 +583,6 @@
577583 tim = rt;
578584 m_DateTo.SetTime(&tim);
579585
580- temp.LoadString(IDS_MSGBOX_OK);
581- GetDlgItem(IDOK)->SetWindowText(temp);
582-
583586 GetDlgItem(IDC_GETALL)->EnableWindow(TRUE);
584587
585588 if (!m_bShowedAll)
@@ -593,6 +596,8 @@
593596 m_LogList.SetRedraw(false);
594597 CUtils::ResizeAllListCtrlCols(&m_LogList);
595598 m_LogList.SetRedraw(true);
599+ temp.LoadString(IDS_MSGBOX_OK);
600+ GetDlgItem(IDOK)->SetWindowText(temp);
596601 POINT pt;
597602 GetCursorPos(&pt);
598603 SetCursorPos(pt.x, pt.y);
--- branches/1.2.x/src/TortoiseProc/LogPromptDlg.cpp (revision 4715)
+++ branches/1.2.x/src/TortoiseProc/LogPromptDlg.cpp (revision 4716)
@@ -339,7 +339,7 @@
339339
340340 DWORD dwShow = SVNSLC_SHOWVERSIONEDBUTNORMALANDEXTERNALS | SVNSLC_SHOWLOCKS;
341341 dwShow |= DWORD(m_regAddBeforeCommit) ? SVNSLC_SHOWUNVERSIONED : 0;
342- m_ListCtrl.Show(dwShow, SVNSLC_SHOWDIRECTS|SVNSLC_SHOWMODIFIED|SVNSLC_SHOWADDED|SVNSLC_SHOWREMOVED|SVNSLC_SHOWMISSING|SVNSLC_SHOWREPLACED|SVNSLC_SHOWMERGED|SVNSLC_SHOWLOCKS);
342+ m_ListCtrl.Show(dwShow, SVNSLC_SHOWDIRECTS|SVNSLC_SHOWMODIFIED|SVNSLC_SHOWADDED|SVNSLC_SHOWREMOVED|SVNSLC_SHOWREPLACED|SVNSLC_SHOWMERGED|SVNSLC_SHOWLOCKS);
343343
344344 if (m_ListCtrl.HasExternalsFromDifferentRepos())
345345 {
--- branches/1.2.x/src/TortoiseProc/MergeDlg.cpp (revision 4715)
+++ branches/1.2.x/src/TortoiseProc/MergeDlg.cpp (revision 4716)
@@ -230,7 +230,7 @@
230230 AfxGetApp()->DoWaitCursor(1);
231231 // create a unified diff of the merge
232232 SVNDiff diff(NULL, this->m_hWnd);
233- diff.ShowUnifiedDiff(CTSVNPath(m_URLFrom), StartRev, CTSVNPath(m_URLTo), EndRev, StartRev);
233+ diff.ShowUnifiedDiff(CTSVNPath(m_URLFrom), StartRev, CTSVNPath(m_URLTo), EndRev, EndRev);
234234
235235 AfxGetApp()->DoWaitCursor(-1);
236236 }
@@ -394,7 +394,6 @@
394394 m_pLogDlg = new CLogDlg();
395395 CRegDWORD reg = CRegDWORD(_T("Software\\TortoiseSVN\\NumberOfLogs"), 100);
396396 int limit = (int)(LONG)reg;
397- m_pLogDlg->SetParams(CTSVNPath(url), SVNRev::REV_HEAD, 1, limit, TRUE, FALSE);
398397 m_pLogDlg->m_wParam = (m_bUseFromURL ? (MERGE_REVSELECTSTARTEND | MERGE_REVSELECTMINUSONE) : MERGE_REVSELECTSTART);
399398 if (m_bUseFromURL)
400399 m_pLogDlg->SetDialogTitle(CString(MAKEINTRESOURCE(IDS_MERGE_SELECTRANGE)));
@@ -403,6 +402,7 @@
403402 m_pLogDlg->SetSelect(true);
404403 m_pLogDlg->m_pNotifyWindow = this;
405404 m_pLogDlg->Create(IDD_LOGMESSAGE, this);
405+ m_pLogDlg->SetParams(CTSVNPath(url), SVNRev::REV_HEAD, 1, limit, TRUE, FALSE);
406406 m_pLogDlg->ShowWindow(SW_SHOW);
407407 }
408408 AfxGetApp()->DoWaitCursor(-1);
@@ -426,7 +426,6 @@
426426 m_pLogDlg2 = new CLogDlg();
427427 CRegDWORD reg = CRegDWORD(_T("Software\\TortoiseSVN\\NumberOfLogs"), 100);
428428 int limit = (int)(LONG)reg;
429- m_pLogDlg2->SetParams(CTSVNPath(url), SVNRev::REV_HEAD, 1, limit, TRUE, FALSE);
430429 m_pLogDlg2->m_wParam = (m_bUseFromURL ? (MERGE_REVSELECTSTARTEND | MERGE_REVSELECTMINUSONE) : MERGE_REVSELECTEND);
431430 if (m_bUseFromURL)
432431 m_pLogDlg2->SetDialogTitle(CString(MAKEINTRESOURCE(IDS_MERGE_SELECTRANGE)));
@@ -435,6 +434,7 @@
435434 m_pLogDlg2->SetSelect(true);
436435 m_pLogDlg2->m_pNotifyWindow = this;
437436 m_pLogDlg2->Create(IDD_LOGMESSAGE, this);
437+ m_pLogDlg2->SetParams(CTSVNPath(url), SVNRev::REV_HEAD, 1, limit, TRUE, FALSE);
438438 m_pLogDlg2->ShowWindow(SW_SHOW);
439439 }
440440 AfxGetApp()->DoWaitCursor(-1);
--- branches/1.2.x/src/TortoiseProc/RepositoryBrowser.cpp (revision 4715)
+++ branches/1.2.x/src/TortoiseProc/RepositoryBrowser.cpp (revision 4716)
@@ -255,11 +255,13 @@
255255 BOOL bLocked = FALSE;
256256
257257 int si = m_treeRepository.GetFirstSelectedItem();
258+ if (si == RVI_INVALID)
259+ return;
258260 do
259261 {
260262 if (m_treeRepository.IsFolder(m_treeRepository.GetItemHandle(si)))
261263 hasFolders = TRUE;
262- if (!m_treeRepository.GetItemText(si, 5).IsEmpty())
264+ if (!m_treeRepository.GetItemText(si, 6).IsEmpty())
263265 bLocked = TRUE;
264266 si = m_treeRepository.GetNextSelectedItem(si);
265267 } while (si != RVI_INVALID);
--- branches/1.2.x/src/TortoiseProc/RepositoryTree.cpp (revision 4715)
+++ branches/1.2.x/src/TortoiseProc/RepositoryTree.cpp (revision 4716)
@@ -152,7 +152,7 @@
152152 SetItemText(GetItemIndex(hItem), col, temp);
153153 }
154154 // get the time value and store that in the Param64
155- if (AfxExtractSubString(temp, folder, col, '\t'))
155+ if (AfxExtractSubString(temp, folder, col-1, '\t'))
156156 {
157157 RVITEM rvi;
158158 rvi.nMask = RVIM_PARAM64;
@@ -209,7 +209,7 @@
209209 SetItemText(GetItemIndex(hItem), col, temp);
210210 }
211211 // get the time value and store that in the Param64
212- if (AfxExtractSubString(temp, file, col, '\t'))
212+ if (AfxExtractSubString(temp, file, col-1, '\t'))
213213 {
214214 RVITEM rvi;
215215 rvi.nMask = RVIM_PARAM64;
@@ -523,7 +523,7 @@
523523 return _tstoi(szText1) - _tstoi(szText2);
524524 case 5:
525525 if (rvi2.Param64 > rvi1.Param64)
526- return -11;
526+ return -1;
527527 if (rvi2.Param64 < rvi1.Param64)
528528 return 1;
529529 return 0;
@@ -938,6 +938,7 @@
938938 AddFolder(sDestUrl+_T("/")+destUrlList[index].GetFileOrDirectoryName());
939939 else
940940 AddFile(sDestUrl+_T("/")+destUrlList[index].GetFileOrDirectoryName());
941+ Refresh(hItem);
941942 }
942943 }
943944 }
@@ -995,7 +996,7 @@
995996 AddFolder(sDestUrl+_T("/")+destUrlList[index].GetFileOrDirectoryName());
996997 else
997998 AddFile(sDestUrl+_T("/")+destUrlList[index].GetFileOrDirectoryName());
998- DeleteItem(hItem);
999+ Refresh(hItem);
9991000 }
10001001 }
10011002 }
--- branches/1.2.x/src/TortoiseProc/SVNProgressDlg.cpp (revision 4715)
+++ branches/1.2.x/src/TortoiseProc/SVNProgressDlg.cpp (revision 4716)
@@ -113,7 +113,7 @@
113113 // Make sure the item is *entirely* visible even if the horizontal
114114 // scroll bar is visible.
115115 int count = m_ProgList.GetCountPerPage();
116- if (iInsertedAt <= (m_ProgList.GetTopIndex() + count))
116+ if (iInsertedAt <= (m_ProgList.GetTopIndex() + count + 2))
117117 m_ProgList.EnsureVisible(iInsertedAt, false);
118118 }
119119 }
@@ -1209,7 +1209,11 @@
12091209 // the impression that the OK button was pressed.
12101210 if ((!m_bThreadRunning)&&(!GetDlgItem(IDCANCEL)->IsWindowEnabled())
12111211 &&(GetDlgItem(IDOK)->IsWindowEnabled())&&(GetDlgItem(IDOK)->IsWindowVisible()))
1212+ {
1213+ // since we convert ESC to RETURN, make sure the OK button has the focus.
1214+ GetDlgItem(IDOK)->SetFocus();
12121215 pMsg->wParam = VK_RETURN;
1216+ }
12131217 }
12141218 if (pMsg->wParam == 'A')
12151219 {
--- branches/1.2.x/src/TortoiseSVNSetup/CustomActions/CustomActions.cpp (revision 4715)
+++ branches/1.2.x/src/TortoiseSVNSetup/CustomActions/CustomActions.cpp (revision 4716)
@@ -25,7 +25,7 @@
2525 RegDeleteValue(hKey, _T("CachePath"));
2626 RegCloseKey(hKey);
2727 }
28- SendMessage(hWnd, WM_CLOSE, NULL, NULL);
28+ PostMessage(hWnd, WM_CLOSE, NULL, NULL);
2929 Sleep(1500);
3030 if (!IsWindow(hWnd))
3131 {
--- branches/1.2.x/src/TortoiseSVNSetup/MakeMsi.bat (revision 4715)
+++ branches/1.2.x/src/TortoiseSVNSetup/MakeMsi.bat (revision 4716)
@@ -18,7 +18,7 @@
1818 ) ELSE (
1919 SET DictionaryENGB=0
2020 )
21-if EXIST ..\..\..\MYBUILD (
21+if EXIST ..\..\MYBUILD (
2222 SET IncludeCrashReportDll=1
2323 ) ELSE (
2424 SET IncludeCrashReportDll=0
--- branches/1.2.x/src/TortoiseShell/ContextMenu.cpp (revision 4715)
+++ branches/1.2.x/src/TortoiseShell/ContextMenu.cpp (revision 4716)
@@ -46,6 +46,7 @@
4646 isIgnored = false;
4747 isInVersionedFolder = false;
4848 isAdded = false;
49+ isDeleted = false;
4950 isLocked = false;
5051 isPatchFile = false;
5152 stdstring statuspath;
@@ -139,6 +140,8 @@
139140 isConflicted = true;
140141 if (status == svn_wc_status_added)
141142 isAdded = true;
143+ if (status == svn_wc_status_deleted)
144+ isDeleted = true;
142145 }
143146 }
144147 } // for (int i = 0; i < count; i++)
@@ -227,6 +230,8 @@
227230 isConflicted = true;
228231 if (status == svn_wc_status_added)
229232 isAdded = true;
233+ if (status == svn_wc_status_deleted)
234+ isDeleted = true;
230235 }
231236 }
232237 } // for (int i = 0; i < count; ++i)
@@ -337,6 +342,8 @@
337342 isFolder = true;
338343 if (status == svn_wc_status_added)
339344 isAdded = true;
345+ if (status == svn_wc_status_deleted)
346+ isDeleted = true;
340347 }
341348 }
342349
@@ -380,6 +387,8 @@
380387
381388 HBITMAP CShellExt::IconToBitmap(UINT uIcon, COLORREF transparentColor)
382389 {
390+ if (bitmaps.find(uIcon) != bitmaps.end())
391+ return bitmaps[uIcon];
383392 HICON hIcon = (HICON)LoadImage(g_hResInst, MAKEINTRESOURCE(uIcon), IMAGE_ICON, 10, 10, LR_DEFAULTCOLOR);
384393 if (!hIcon)
385394 return NULL;
@@ -438,10 +447,10 @@
438447
439448 // Restore settings
440449 ::SelectObject(dst_hdc, old_dst_bmp);
441- ::DeleteObject(bmp);
442450 ::DeleteDC(dst_hdc);
443451 ::ReleaseDC(desktop, screen_dev);
444452 DestroyIcon(hIcon);
453+ bitmaps[uIcon] = bmp;
445454 return bmp;
446455 }
447456
@@ -494,6 +503,7 @@
494503 {
495504 ATLTRACE("Shell :: QueryContextMenu\n");
496505 PreserveChdir preserveChdir;
506+
497507 //first check if our drophandler is called
498508 //and then (if true) provide the context menu for the
499509 //drop handler
@@ -721,8 +731,10 @@
721731
722732 if ((!isInSVN)&&(isFolder)&&(!isFolderInSVN))
723733 InsertSVNMenu(ownerdrawn, ISTOP(MENUCREATEREPOS), HMENU(MENUCREATEREPOS), INDEXMENU(MENUCREATEREPOS), idCmd++, IDS_MENUCREATEREPOS, IDI_CREATEREPOS, idCmdFirst, CreateRepos);
724- if ((!isInSVN && isInVersionedFolder)||(isInSVN && isFolder)||(isIgnored))
734+ if ((!isInSVN && isInVersionedFolder)||(isInSVN && isFolder)||(isIgnored)||(!isFolder && isDeleted && !isOnlyOneItemSelected))
725735 InsertSVNMenu(ownerdrawn, ISTOP(MENUADD), HMENU(MENUADD), INDEXMENU(MENUADD), idCmd++, IDS_MENUADD, IDI_ADD, idCmdFirst, Add);
736+ else if (!isFolder && isDeleted && isOnlyOneItemSelected)
737+ InsertSVNMenu(ownerdrawn, ISTOP(MENUADD), HMENU(MENUADD), INDEXMENU(MENUADD), idCmd++, IDS_MENUADDASREPLACEMENT, IDI_ADD, idCmdFirst, AddAsReplacement);
726738 if ((!isInSVN)&&(isFolder))
727739 InsertSVNMenu(ownerdrawn, ISTOP(MENUIMPORT), HMENU(MENUIMPORT), INDEXMENU(MENUIMPORT), idCmd++, IDS_MENUIMPORT, IDI_IMPORT, idCmdFirst, Import);
728740 if ((isInSVN)&&(!isFolder)&&(!isAdded)&&(isOnlyOneItemSelected))
@@ -965,6 +977,7 @@
965977 svnCmd += _T("\"");
966978 break;
967979 case Add:
980+ case AddAsReplacement:
968981 tempfile = WriteFileListToTempFile();
969982 svnCmd += _T("add /path:\"");
970983 svnCmd += tempfile;
@@ -1660,6 +1673,12 @@
16601673 SETSPACE(MENUADD);
16611674 PREPENDSVN(MENUADD);
16621675 break;
1676+ case AddAsReplacement:
1677+ MAKESTRING(IDS_MENUADDASREPLACEMENT);
1678+ resource = MAKEINTRESOURCE(IDI_ADD);
1679+ SETSPACE(MENUADD);
1680+ PREPENDSVN(MENUADD);
1681+ break;
16631682 case Revert:
16641683 MAKESTRING(IDS_MENUREVERT);
16651684 resource = MAKEINTRESOURCE(IDI_REVERT);
--- branches/1.2.x/src/TortoiseShell/ShellExt.cpp (revision 4715)
+++ branches/1.2.x/src/TortoiseShell/ShellExt.cpp (revision 4716)
@@ -49,6 +49,12 @@
4949
5050 CShellExt::~CShellExt()
5151 {
52+ std::map<UINT, HBITMAP>::iterator it;
53+ for (it = bitmaps.begin(); it != bitmaps.end(); ++it)
54+ {
55+ ::DeleteObject(it->second);
56+ }
57+ bitmaps.clear();
5258 g_cRefThisDll--;
5359 apr_terminate();
5460 }
--- branches/1.2.x/src/TortoiseShell/ShellExt.h (revision 4715)
+++ branches/1.2.x/src/TortoiseShell/ShellExt.h (revision 4716)
@@ -97,6 +97,7 @@
9797 Update,
9898 Commit,
9999 Add,
100+ AddAsReplacement,
100101 Revert,
101102 Cleanup,
102103 Resolve,
@@ -157,6 +158,7 @@
157158 bool isFolderInSVN;
158159 bool isNormal;
159160 bool isAdded;
161+ bool isDeleted;
160162 bool isLocked;
161163 bool isPatchFile;
162164 int space;
@@ -169,6 +171,7 @@
169171 stdstring owner;
170172 svn_revnum_t columnrev; ///< holds the corresponding revision to the file/dir above
171173 svn_wc_status_kind filestatus;
174+ std::map<UINT, HBITMAP> bitmaps;
172175 #define MAKESTRING(ID) LoadStringEx(g_hResInst, ID, stringtablebuffer, sizeof(stringtablebuffer), (WORD)CRegStdWORD(_T("Software\\TortoiseSVN\\LanguageID"), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT)))
173176 //#define MAKESTRING(ID) LoadString(g_hResInst, ID, stringtablebuffer, sizeof(stringtablebuffer))
174177 private:
--- branches/1.2.x/src/TortoiseShell/resource.h (revision 4715)
+++ branches/1.2.x/src/TortoiseShell/resource.h (revision 4716)
@@ -164,6 +164,7 @@
164164 #define IDS_COLTITLEAUTHOR 251
165165 #define IDS_COLDESCAUTHOR 252
166166 #define IDS_FILEPROPONFOLDER 253
167+#define IDS_MENUADDASREPLACEMENT 255
167168 #define IDC_REVISION 1001
168169 #define IDC_LOCKED 1002
169170 #define IDC_REPOURL 1003
--- branches/1.2.x/src/Utils/PathUtils.cpp (revision 4715)
+++ branches/1.2.x/src/Utils/PathUtils.cpp (revision 4716)
@@ -36,11 +36,14 @@
3636 do
3737 {
3838 ZeroMemory(buf, (len+10)*sizeof(TCHAR));
39- _tcsncpy(buf, internalpathbuf, _tcschr(pPath, '\\') - internalpathbuf);
39+ TCHAR * slashpos = _tcschr(pPath, '\\');
40+ if (slashpos)
41+ _tcsncpy(buf, internalpathbuf, slashpos - internalpathbuf);
42+ else
43+ _tcsncpy(buf, internalpathbuf, len+10);
4044 CreateDirectory(buf, &attribs);
4145 pPath = _tcschr(pPath, '\\');
42- pPath++;
43- } while (_tcschr(pPath, '\\'));
46+ } while ((pPath++)&&(_tcschr(pPath, '\\')));
4447
4548 BOOL bRet = CreateDirectory(internalpathbuf, &attribs);
4649 delete buf;
--- branches/1.2.x/src/Utils/SciEdit.cpp (revision 4715)
+++ branches/1.2.x/src/Utils/SciEdit.cpp (revision 4716)
@@ -578,6 +578,9 @@
578578 {
579579 int anchor = Call(SCI_GETANCHOR);
580580 int currentpos = Call(SCI_GETCURRENTPOS);
581+ int selstart = Call(SCI_GETSELECTIONSTART);
582+ int selend = Call(SCI_GETSELECTIONEND);
583+ int pointpos = 0;
581584 if ((point.x == -1) && (point.y == -1))
582585 {
583586 CRect rect;
@@ -591,9 +594,7 @@
591594 // right-clicked.
592595 CPoint clientpoint = point;
593596 ScreenToClient(&clientpoint);
594- int pointpos = Call(SCI_POSITIONFROMPOINT, clientpoint.x, clientpoint.y);
595- Call(SCI_SETANCHOR, pointpos);
596- Call(SCI_SETCURRENTPOS, pointpos);
597+ pointpos = Call(SCI_POSITIONFROMPOINT, clientpoint.x, clientpoint.y);
597598 }
598599 CString sMenuItemText;
599600 CMenu popup;
@@ -601,7 +602,7 @@
601602 {
602603 bool bCanUndo = !!Call(SCI_CANUNDO);
603604 bool bCanRedo = !!Call(SCI_CANREDO);
604- bool bHasSelection = (Call(SCI_GETANCHOR) != Call(SCI_GETCURRENTPOS));
605+ bool bHasSelection = (selend-selstart > 0);
605606 bool bCanPaste = !!Call(SCI_CANPASTE);
606607 UINT uEnabledMenu = MF_STRING | MF_ENABLED;
607608 UINT uDisabledMenu = MF_STRING | MF_GRAYED;
@@ -640,8 +641,20 @@
640641 popup.AppendMenu(MF_SEPARATOR);
641642 }
642643 int menuid = nCustoms;
643-
644- CString sWord = GetWordUnderCursor();
644+
645+ CString sWord;
646+ if (pointpos)
647+ {
648+ // setting the cursor clears the selection
649+ Call(SCI_SETANCHOR, pointpos);
650+ Call(SCI_SETCURRENTPOS, pointpos);
651+ sWord = GetWordUnderCursor();
652+ // restore the selection
653+ Call(SCI_SETSELECTIONSTART, selstart);
654+ Call(SCI_SETSELECTIONEND, selend);
655+ }
656+ else
657+ sWord = GetWordUnderCursor();
645658 CStringA worda = CStringA(sWord);
646659 if ((sWord.GetLength()<PDICT_MAX_WORD_LENGTH)&&((pChecker)&&(m_autolist.Find(sWord)<0)&&(!pChecker->spell(worda)))&&
647660 (!_istdigit(sWord.GetAt(0)))&&(!m_personalDict.FindWord(sWord)))
@@ -766,14 +779,19 @@
766779 }
767780 else if (cmd <= (nCorrections+nCustoms))
768781 {
782+ Call(SCI_SETANCHOR, pointpos);
783+ Call(SCI_SETCURRENTPOS, pointpos);
769784 GetWordUnderCursor(true);
770785 CString temp;
771786 corrections.GetMenuString(cmd, temp, 0);
787+ // setting the cursor clears the selection
772788 Call(SCI_REPLACESEL, 0, (LPARAM)(LPCSTR)StringForControl(temp));
773789 }
774790 #if THESAURUS
775791 else if (cmd <= (nThesaurs+nCorrections+nCustoms))
776792 {
793+ Call(SCI_SETANCHOR, pointpos);
794+ Call(SCI_SETCURRENTPOS, pointpos);
777795 GetWordUnderCursor(true);
778796 CString temp;
779797 thesaurs.GetMenuString(cmd, temp, 0);
Show on old repository browser