• R/O
  • SSH
  • HTTPS

tortoisesvn: Commit


Commit MetaInfo

Revision23128 (tree)
Zeit2012-08-04 03:57:10
Autorstefankueng

Log Message

Merged revision(s) r23115, r23123, , r23125, r23126, r23127 from trunk:
* Avoid problems with compiler optimizations: declare the variable before the condition so the value isn't discarded too early.
* In case creating the client context fails, check for the invalid context and in case it's invalid, make sure the path gets crawled again. (Fixes issue #383) : access violation if context creation fails
* When removing log caches back-to-front, we may remove more than one entry at a time (i.e. if root + UUID match multiple entries). Instead of using iterators, we must use verifiable direct indexes. (Fixes issue #384) : Crash when removing old log caches
* Treat replacements just like adds when determining whether and where to continue the log. (Fixes issue #385) : Log cache not filled after REPLACE
* * teach build scripts to automatically create config.bat and default.build.user if they are not present * make config.bat.sample slightly more generic

Ändern Zusammenfassung

Diff

--- branches/1.7.x/doc/xsl/fonts/createmetrics.bat (revision 23127)
+++ branches/1.7.x/doc/xsl/fonts/createmetrics.bat (revision 23128)
@@ -6,6 +6,9 @@
66 rem set CMD="java"
77 rem set FONT_DIR=C:\Windows\Fonts
88
9+rem auto-create configuration file
10+if not exist config.bat copy config.bat.sample config.bat
11+
912 rem load configuration file
1013 call config.bat
1114
--- branches/1.7.x/src/Changelog.txt (revision 23127)
+++ branches/1.7.x/src/Changelog.txt (revision 23128)
@@ -108,6 +108,8 @@
108108 log cache. (Stefan Fuhrmann)
109109 - BUG: Issue #382: Don't crash in log cache when path
110110 info is not available. (Stefan Fuhrmann)
111+- BUG: Issue #383: access violation if context
112+ creation fails. (Stefan)
111113
112114 Version 1.7.7
113115 - BUG: Issue #233: Crash when closing the
--- branches/1.7.x/src/LogCache/CacheLogQuery.cpp (revision 23127)
+++ branches/1.7.x/src/LogCache/CacheLogQuery.cpp (revision 23128)
@@ -407,7 +407,8 @@
407407 // end of the requested data. currentPath is NULL, then.)
408408
409409 if ( ( (cache->GetLogInfo().GetSumChanges (index)
410- & CRevisionInfoContainer::ACTION_ADDED) != 0)
410+ & ( CRevisionInfoContainer::ACTION_ADDED
411+ | CRevisionInfoContainer::ACTION_REPLACED)) != 0)
411412 && (currentPath.get() != NULL))
412413 {
413414 // create the appropriate iterator to follow the potential path change
--- branches/1.7.x/src/LogCache/LogCachePool.cpp (revision 23127)
+++ branches/1.7.x/src/LogCache/LogCachePool.cpp (revision 23128)
@@ -1,6 +1,6 @@
11 // TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2007-2011 - TortoiseSVN
3+// Copyright (C) 2007-2012 - 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
@@ -156,13 +156,18 @@
156156 // update cache info list and also remove entries
157157 // that don't have a cache file anymore
158158
159- for ( const CRepositoryInfo::SPerRepositoryInfo* const * iter
160- = repositoryInfo->data.end()
161- , * const *end = repositoryInfo->data.begin()
162- ; iter != end
163- ; --iter)
159+ for (size_t i = repositoryInfo->data.size(); i > 0; --i)
164160 {
165- const CRepositoryInfo::SPerRepositoryInfo* info = *(iter-1);
161+ // DropEntry may remove more than one entry per call
162+
163+ if (i > repositoryInfo->data.size())
164+ continue;
165+
166+ // entry still exists. Check whether we have to remove it
167+
168+ const CRepositoryInfo::SPerRepositoryInfo* info
169+ = repositoryInfo->data[i-1];
170+
166171 if ( (deletedCaches.find (info->fileName) != deletedCaches.end())
167172 || (allFiles.find (info->fileName) == allFiles.end()))
168173 {
@@ -289,13 +294,11 @@
289294 {
290295 std::multimap<CString, CString> result;
291296
292- for ( const CRepositoryInfo::SPerRepositoryInfo* const * iter
293- = repositoryInfo->data.begin()
294- , * const *end = repositoryInfo->data.end()
295- ; iter != end
296- ; ++iter)
297+ for (size_t i = 0, count = repositoryInfo->data.size(); i != count; ++i)
297298 {
298- const CRepositoryInfo::SPerRepositoryInfo* info = *iter;
299+ const CRepositoryInfo::SPerRepositoryInfo* info
300+ = repositoryInfo->data[i];
301+
299302 result.insert (std::make_pair (info->root, info->uuid));
300303 }
301304
--- branches/1.7.x/src/LogCache/RepositoryInfo.cpp (revision 23127)
+++ branches/1.7.x/src/LogCache/RepositoryInfo.cpp (revision 23128)
@@ -1,6 +1,6 @@
11 // TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2007-2011 - TortoiseSVN
3+// Copyright (C) 2007-2012 - 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
@@ -367,16 +367,15 @@
367367
368368 // data access
369369
370-const CRepositoryInfo::SPerRepositoryInfo* const *
371-CRepositoryInfo::CData::begin() const
370+size_t CRepositoryInfo::CData::size() const
372371 {
373- return data.empty() ? NULL : &data.front();
372+ return data.size();
374373 }
375374
376-const CRepositoryInfo::SPerRepositoryInfo* const *
377-CRepositoryInfo::CData::end() const
375+const CRepositoryInfo::SPerRepositoryInfo*
376+CRepositoryInfo::CData::operator[](size_t index) const
378377 {
379- return begin() + data.size();
378+ return data[index];
380379 }
381380
382381 // share the repository info pool thoughout this application
--- branches/1.7.x/src/LogCache/RepositoryInfo.h (revision 23127)
+++ branches/1.7.x/src/LogCache/RepositoryInfo.h (revision 23128)
@@ -1,6 +1,6 @@
11 // TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2007-2009 - TortoiseSVN
3+// Copyright (C) 2007-2009, 2012 - 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
@@ -170,8 +170,8 @@
170170
171171 /// data access
172172
173- const SPerRepositoryInfo* const * begin() const;
174- const SPerRepositoryInfo* const * end() const;
173+ size_t size() const;
174+ const SPerRepositoryInfo* operator[](size_t index) const;
175175 };
176176
177177 /// cached repository properties
--- branches/1.7.x/src/SVN/SVNHelpers.cpp (revision 23127)
+++ branches/1.7.x/src/SVN/SVNHelpers.cpp (revision 23128)
@@ -1,6 +1,6 @@
11 // TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2003-2011 - TortoiseSVN
3+// Copyright (C) 2003-2012 - 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
@@ -78,11 +78,14 @@
7878 if (pool == NULL)
7979 return m_ctx;
8080
81- svn_client_ctx_t * ctx;
81+ svn_client_ctx_t * ctx = nullptr;
8282 svn_error_clear(svn_client_create_context(&ctx, pool));
83- ctx->cancel_func = cancelfunc;
84- ctx->cancel_baton = (void *)this;
85- ctx->config = m_config;
83+ if (ctx)
84+ {
85+ ctx->cancel_func = cancelfunc;
86+ ctx->cancel_baton = (void *)this;
87+ ctx->config = m_config;
88+ }
8689
8790 return ctx;
8891 }
--- branches/1.7.x/src/TSVNCache/CachedDirectory.cpp (revision 23127)
+++ branches/1.7.x/src/TSVNCache/CachedDirectory.cpp (revision 23128)
@@ -513,28 +513,41 @@
513513 return false;
514514 }
515515 m_pCtx = CSVNStatusCache::Instance().m_svnHelp.ClientContext(subPool);
516- svn_error_t* pErr = svn_client_status5 (
517- NULL,
518- m_pCtx,
519- svnapipath,
520- &revision,
521- svn_depth_immediates,
522- TRUE, // get all
523- FALSE, // update
524- TRUE, // no ignores
525- FALSE, // ignore externals
526- TRUE, // depth as sticky
527- NULL, // changelists
528- GetStatusCallback,
529- this,
530- subPool
531- );
516+ svn_error_t * pErr = nullptr;
517+ if (m_pCtx)
518+ {
519+ pErr = svn_client_status5 (
520+ NULL,
521+ m_pCtx,
522+ svnapipath,
523+ &revision,
524+ svn_depth_immediates,
525+ TRUE, // get all
526+ FALSE, // update
527+ TRUE, // no ignores
528+ FALSE, // ignore externals
529+ TRUE, // depth as sticky
530+ NULL, // changelists
531+ GetStatusCallback,
532+ this,
533+ subPool
534+ );
532535
533- svn_wc_context_destroy(m_pCtx->wc_ctx);
534- m_pCtx->wc_ctx = NULL;
535- m_pCtx = NULL;
536+ svn_wc_context_destroy(m_pCtx->wc_ctx);
537+ m_pCtx->wc_ctx = NULL;
538+ m_pCtx = NULL;
539+ }
540+ else
541+ {
542+ CTraceToOutputDebugString::Instance()(__FUNCTION__ ": error creating client context!\n");
543+ m_currentFullStatus = m_mostImportantFileStatus = svn_wc_status_none;
544+ // Since we only assume a none status here due to the fact that we couldn't get a client context,
545+ // make sure that this status times out soon.
546+ CSVNStatusCache::Instance().m_folderCrawler.BlockPath(m_directoryPath, 20);
547+ CSVNStatusCache::Instance().AddFolderForCrawling(m_directoryPath);
548+ }
536549 InterlockedExchange(&m_FetchingStatus, FALSE);
537- if(pErr)
550+ if (pErr)
538551 {
539552 // Handle an error
540553 // The most likely error on a folder is that it's not part of a WC
--- branches/1.7.x/src/TortoiseMerge/MainFrm.cpp (revision 23127)
+++ branches/1.7.x/src/TortoiseMerge/MainFrm.cpp (revision 23128)
@@ -830,8 +830,10 @@
830830 }
831831 else
832832 {
833- bool bGoFirstDiff = (0 != (DWORD)CRegDWORD(_T("Software\\TortoiseMerge\\FirstDiffOnLoad"), TRUE));
834- bool bGoFirstConflict = (0 != (DWORD)CRegDWORD(_T("Software\\TortoiseMerge\\FirstConflictOnLoad"), TRUE));
833+ CRegDWORD regFirstDiff = CRegDWORD(_T("Software\\TortoiseMerge\\FirstDiffOnLoad"), TRUE);
834+ CRegDWORD regFirstConflict = CRegDWORD(_T("Software\\TortoiseMerge\\FirstConflictOnLoad"), TRUE);
835+ bool bGoFirstDiff = (0 != (DWORD)regFirstDiff);
836+ bool bGoFirstConflict = (0 != (DWORD)regFirstConflict);
835837 if (bGoFirstConflict && (CheckResolved()>=0))
836838 {
837839 pwndActiveView->GoToFirstConflict();
--- branches/1.7.x/src/TortoiseProc/RevisionGraph/FullGraphBuilder.cpp (revision 23127)
+++ branches/1.7.x/src/TortoiseProc/RevisionGraph/FullGraphBuilder.cpp (revision 23128)
@@ -633,6 +633,7 @@
633633 break;
634634
635635 case CRevisionInfoContainer::ACTION_ADDED:
636+ case CRevisionInfoContainer::ACTION_REPLACED:
636637 // exact addition? -> does exist
637638
638639 if (iter->GetPathID() == path.GetIndex())
Show on old repository browser