OSDN Git Service

Fix some TGitCache build error
authorFrank Li <lznuaa@gmail.com>
Tue, 6 Jan 2009 16:01:41 +0000 (00:01 +0800)
committerFrank Li <lznuaa@gmail.com>
Tue, 6 Jan 2009 16:01:41 +0000 (00:01 +0800)
Signed-off-by: Frank Li <lznuaa@gmail.com>
16 files changed:
src/TGitCache/CacheInterface.h
src/TGitCache/CachedDirectory.cpp
src/TGitCache/CachedDirectory.h
src/TGitCache/DirectoryWatcher.cpp
src/TGitCache/DirectoryWatcher.h
src/TGitCache/FolderCrawler.cpp
src/TGitCache/FolderCrawler.h
src/TGitCache/GitStatusCache.h
src/TGitCache/SVNStatusCache.cpp
src/TGitCache/ShellUpdater.cpp
src/TGitCache/ShellUpdater.h
src/TGitCache/StatusCacheEntry.cpp
src/TGitCache/StatusCacheEntry.h
src/TGitCache/TSVNCache.cpp
src/TGitCache/TSVNCache.vcproj
src/TortoiseGit.sln

index 2c20220..fdd886b 100644 (file)
 #pragma once\r
 #include "wininet.h"\r
 \r
+#include "GitStatus.h"\r
 // The name of the named-pipe for the cache\r
 #ifdef WIN64\r
-#define TSVN_CACHE_PIPE_NAME _T("\\\\.\\pipe\\TSVNCache64")\r
-#define TSVN_CACHE_COMMANDPIPE_NAME _T("\\\\.\\pipe\\TSVNCacheCommand64")\r
-#define TSVN_CACHE_WINDOW_NAME _T("TSVNCacheWindow64")\r
-#define TSVN_CACHE_MUTEX_NAME _T("TSVNCacheMutex64")\r
+#define TSVN_CACHE_PIPE_NAME _T("\\\\.\\pipe\\TGitCache64")\r
+#define TSVN_CACHE_COMMANDPIPE_NAME _T("\\\\.\\pipe\\TGitCacheCommand64")\r
+#define TSVN_CACHE_WINDOW_NAME _T("TGitCacheWindow64")\r
+#define TSVN_CACHE_MUTEX_NAME _T("TGitCacheMutex64")\r
 #else\r
-#define TSVN_CACHE_PIPE_NAME _T("\\\\.\\pipe\\TSVNCache")\r
-#define TSVN_CACHE_COMMANDPIPE_NAME _T("\\\\.\\pipe\\TSVNCacheCommand")\r
-#define TSVN_CACHE_WINDOW_NAME _T("TSVNCacheWindow")\r
-#define TSVN_CACHE_MUTEX_NAME _T("TSVNCacheMutex")\r
+#define TSVN_CACHE_PIPE_NAME _T("\\\\.\\pipe\\TGitCache")\r
+#define TSVN_CACHE_COMMANDPIPE_NAME _T("\\\\.\\pipe\\TGitCacheCommand")\r
+#define TSVN_CACHE_WINDOW_NAME _T("TGitCacheWindow")\r
+#define TSVN_CACHE_MUTEX_NAME _T("TGitCacheMutex")\r
 #endif\r
 \r
 CString GetCachePipeName();\r
@@ -51,7 +52,7 @@ struct TSVNCacheRequest
 \r
 // CustomActions will use this header but does not need nor understand the SVN types ...\r
 \r
-#ifdef SVN_WC_H\r
+//#ifdef SVN_WC_H\r
 \r
 /**\r
  * \ingroup TSVNCache\r
@@ -59,9 +60,9 @@ struct TSVNCacheRequest
  */\r
 struct TSVNCacheResponse\r
 {\r
-       svn_wc_status2_t m_status;\r
-       svn_wc_entry_t m_entry;\r
-       svn_node_kind_t m_kind;\r
+       git_wc_status2_t m_status;\r
+//     svn_wc_entry_t m_entry;\r
+//     svn_node_kind_t m_kind;\r
        char m_url[INTERNET_MAX_URL_LENGTH+1];\r
        char m_owner[255];              ///< owner of the lock\r
        char m_author[255];\r
@@ -69,7 +70,7 @@ struct TSVNCacheResponse
        bool m_needslock;               ///< whether the file has the svn:needs-lock property set or not (only works with the new working copy version)\r
 };\r
 \r
-#endif // SVN_WC_H\r
+//#endif // SVN_WC_H\r
 \r
 /**\r
  * \ingroup TSVNCache\r
index 5db9d28..53fa719 100644 (file)
@@ -18,9 +18,9 @@
 //\r
 #include "StdAfx.h"\r
 #include ".\cacheddirectory.h"\r
-#include "SVNHelpers.h"\r
-#include "SVNStatusCache.h"\r
-#include "SVNStatus.h"\r
+//#include "SVNHelpers.h"\r
+#include "GitStatusCache.h"\r
+#include "GitStatus.h"\r
 #include <set>\r
 \r
 CCachedDirectory::CCachedDirectory(void)\r
@@ -29,7 +29,7 @@ CCachedDirectory::CCachedDirectory(void)
        m_propsFileTime = 0;\r
        m_currentStatusFetchingPathTicks = 0;\r
        m_bCurrentFullStatusValid = false;\r
-       m_currentFullStatus = m_mostImportantFileStatus = svn_wc_status_none;\r
+       m_currentFullStatus = m_mostImportantFileStatus = git_wc_status_none;\r
        m_bRecursive = true;\r
 }\r
 \r
@@ -37,7 +37,7 @@ CCachedDirectory::~CCachedDirectory(void)
 {\r
 }\r
 \r
-CCachedDirectory::CCachedDirectory(const CTSVNPath& directoryPath)\r
+CCachedDirectory::CCachedDirectory(const CTGitPath& directoryPath)\r
 {\r
        ATLASSERT(directoryPath.IsDirectory() || !PathFileExists(directoryPath.GetWinPath()));\r
 \r
@@ -46,7 +46,7 @@ CCachedDirectory::CCachedDirectory(const CTSVNPath& directoryPath)
        m_propsFileTime = 0;\r
        m_currentStatusFetchingPathTicks = 0;\r
        m_bCurrentFullStatusValid = false;\r
-       m_currentFullStatus = m_mostImportantFileStatus = svn_wc_status_none;\r
+       m_currentFullStatus = m_mostImportantFileStatus = git_wc_status_none;\r
        m_bRecursive = true;\r
 }\r
 \r
@@ -84,7 +84,7 @@ BOOL CCachedDirectory::SaveToDisk(FILE * pFile)
                {\r
                        if (fwrite((LPCTSTR)path, sizeof(TCHAR), value, pFile)!=value)\r
                                return false;\r
-                       svn_wc_status_kind status = I->second;\r
+                       git_wc_status_kind status = I->second;\r
                        WRITEVALUETOFILE(status);\r
                }\r
        }\r
@@ -151,9 +151,9 @@ BOOL CCachedDirectory::LoadFromDisk(FILE * pFile)
                                        return false;\r
                                }\r
                                sPath.ReleaseBuffer(value);\r
-                               svn_wc_status_kind status;\r
+                               git_wc_status_kind status;\r
                                LOADVALUEFROMFILE(status);\r
-                               m_childDirectories[CTSVNPath(sPath)] = status;\r
+                               m_childDirectories[CTGitPath(sPath)] = status;\r
                        }\r
                }\r
                LOADVALUEFROMFILE(m_entriesFileTime);\r
@@ -186,7 +186,7 @@ BOOL CCachedDirectory::LoadFromDisk(FILE * pFile)
 \r
 }\r
 \r
-CStatusCacheEntry CCachedDirectory::GetStatusForMember(const CTSVNPath& path, bool bRecursive,  bool bFetch /* = true */)\r
+CStatusCacheEntry CCachedDirectory::GetStatusForMember(const CTGitPath& path, bool bRecursive,  bool bFetch /* = true */)\r
 {\r
        CString strCacheKey;\r
        bool bThisDirectoryIsUnversioned = false;\r
@@ -200,17 +200,17 @@ CStatusCacheEntry CCachedDirectory::GetStatusForMember(const CTSVNPath& path, bo
        ATLASSERT(m_directoryPath.IsEquivalentToWithoutCase(path.GetContainingDirectory()) || bRequestForSelf);\r
 \r
        // Check if the entries file has been changed\r
-       CTSVNPath entriesFilePath(m_directoryPath);\r
-       CTSVNPath propsDirPath(m_directoryPath);\r
-       if (g_SVNAdminDir.IsVSNETHackActive())\r
+       CTGitPath entriesFilePath(m_directoryPath);\r
+       CTGitPath propsDirPath(m_directoryPath);\r
+       if (g_GitAdminDir.IsVSNETHackActive())\r
        {\r
-               entriesFilePath.AppendPathString(g_SVNAdminDir.GetVSNETAdminDirName() + _T("\\entries"));\r
-               propsDirPath.AppendPathString(g_SVNAdminDir.GetVSNETAdminDirName() + _T("\\dir-props"));\r
+               entriesFilePath.AppendPathString(g_GitAdminDir.GetVSNETAdminDirName() + _T("\\entries"));\r
+               propsDirPath.AppendPathString(g_GitAdminDir.GetVSNETAdminDirName() + _T("\\dir-props"));\r
        }\r
        else\r
        {\r
-               entriesFilePath.AppendPathString(g_SVNAdminDir.GetAdminDirName() + _T("\\entries"));\r
-               propsDirPath.AppendPathString(g_SVNAdminDir.GetAdminDirName() + _T("\\dir-props"));\r
+               entriesFilePath.AppendPathString(g_GitAdminDir.GetAdminDirName() + _T("\\entries"));\r
+               propsDirPath.AppendPathString(g_GitAdminDir.GetAdminDirName() + _T("\\dir-props"));\r
        }\r
        if ( (m_entriesFileTime == entriesFilePath.GetLastWriteTime()) && ((entriesFilePath.GetLastWriteTime() == 0) || (m_propsFileTime == propsDirPath.GetLastWriteTime())) )\r
        {\r
@@ -244,7 +244,7 @@ CStatusCacheEntry CCachedDirectory::GetStatusForMember(const CTSVNPath& path, bo
                                // lock and not a write lock!\r
                                // So mark it for crawling, and let the crawler remove it\r
                                // later\r
-                               CSVNStatusCache::Instance().AddFolderForCrawling(path.GetContainingDirectory());\r
+                               CGitStatusCache::Instance().AddFolderForCrawling(path.GetContainingDirectory());\r
                                return CStatusCacheEntry();\r
                        }\r
                        else\r
@@ -262,7 +262,7 @@ CStatusCacheEntry CCachedDirectory::GetStatusForMember(const CTSVNPath& path, bo
                {\r
                        // We don't have directory status in our cache\r
                        // Ask the directory if it knows its own status\r
-                       CCachedDirectory * dirEntry = CSVNStatusCache::Instance().GetDirectoryCacheEntry(path);\r
+                       CCachedDirectory * dirEntry = CGitStatusCache::Instance().GetDirectoryCacheEntry(path);\r
                        if ((dirEntry)&&(dirEntry->IsOwnStatusValid()))\r
                        {\r
                                // To keep recursive status up to date, we'll request that children are all crawled again\r
@@ -273,7 +273,7 @@ CStatusCacheEntry CCachedDirectory::GetStatusForMember(const CTSVNPath& path, bo
                                        ChildDirStatus::const_iterator it;\r
                                        for(it = dirEntry->m_childDirectories.begin(); it != dirEntry->m_childDirectories.end(); ++it)\r
                                        {\r
-                                               CSVNStatusCache::Instance().AddFolderForCrawling(it->first);\r
+                                               CGitStatusCache::Instance().AddFolderForCrawling(it->first);\r
                                        }\r
                                }\r
 \r
@@ -296,7 +296,7 @@ CStatusCacheEntry CCachedDirectory::GetStatusForMember(const CTSVNPath& path, bo
                                        if ((m_currentStatusFetchingPath.IsAncestorOf(path))&&((m_currentStatusFetchingPathTicks + 1000)<GetTickCount()))\r
                                        {\r
                                                ATLTRACE(_T("returning empty status (status fetch in progress) for %s\n"), path.GetWinPath());\r
-                                               m_currentFullStatus = m_mostImportantFileStatus = svn_wc_status_none;\r
+                                               m_currentFullStatus = m_mostImportantFileStatus = git_wc_status_none;\r
                                                return CStatusCacheEntry();\r
                                        }\r
                                }\r
@@ -312,7 +312,7 @@ CStatusCacheEntry CCachedDirectory::GetStatusForMember(const CTSVNPath& path, bo
                                {\r
                                        if(itMap->second.DoesFileTimeMatch(path.GetLastWriteTime()))\r
                                        {\r
-                                               if ((itMap->second.GetEffectiveStatus()!=svn_wc_status_missing)||(!PathFileExists(path.GetWinPath())))\r
+                                               if ((itMap->second.GetEffectiveStatus()!=git_wc_status_missing)||(!PathFileExists(path.GetWinPath())))\r
                                                {\r
                                                        // Note: the filetime matches after a modified has been committed too.\r
                                                        // So in that case, we would return a wrong status (e.g. 'modified' instead\r
@@ -332,7 +332,7 @@ CStatusCacheEntry CCachedDirectory::GetStatusForMember(const CTSVNPath& path, bo
                        if ((m_currentStatusFetchingPath.IsAncestorOf(path))&&((m_currentStatusFetchingPathTicks + 1000)<GetTickCount()))\r
                        {\r
                                ATLTRACE(_T("returning empty status (status fetch in progress) for %s\n"), path.GetWinPath());\r
-                               m_currentFullStatus = m_mostImportantFileStatus = svn_wc_status_none;\r
+                               m_currentFullStatus = m_mostImportantFileStatus = git_wc_status_none;\r
                                return CStatusCacheEntry();\r
                        }\r
                }\r
@@ -343,7 +343,7 @@ CStatusCacheEntry CCachedDirectory::GetStatusForMember(const CTSVNPath& path, bo
                // We leave the refreshing to the crawler.\r
                if ((!bFetch)&&(m_entriesFileTime))\r
                {\r
-                       CSVNStatusCache::Instance().AddFolderForCrawling(path.GetDirectory());\r
+                       CGitStatusCache::Instance().AddFolderForCrawling(path.GetDirectory());\r
                        return CStatusCacheEntry();\r
                }\r
                AutoLocker lock(m_critSec);\r
@@ -353,13 +353,13 @@ CStatusCacheEntry CCachedDirectory::GetStatusForMember(const CTSVNPath& path, bo
                strCacheKey = GetCacheKey(path);\r
        }\r
 \r
-       svn_opt_revision_t revision;\r
-       revision.kind = svn_opt_revision_unspecified;\r
+//     svn_opt_revision_t revision;\r
+//     revision.kind = svn_opt_revision_unspecified;\r
 \r
        // We've not got this item in the cache - let's add it\r
        // We never bother asking SVN for the status of just one file, always for its containing directory\r
 \r
-       if (g_SVNAdminDir.IsAdminDirPath(path.GetWinPathString()))\r
+       if (g_GitAdminDir.IsAdminDirPath(path.GetWinPathString()))\r
        {\r
                // We're being asked for the status of an .SVN directory\r
                // It's not worth asking for this\r
@@ -374,15 +374,15 @@ CStatusCacheEntry CCachedDirectory::GetStatusForMember(const CTSVNPath& path, bo
                                if ((m_currentStatusFetchingPath.IsAncestorOf(path))&&((m_currentStatusFetchingPathTicks + 1000)<GetTickCount()))\r
                                {\r
                                        ATLTRACE(_T("returning empty status (status fetch in progress) for %s\n"), path.GetWinPath());\r
-                                       m_currentFullStatus = m_mostImportantFileStatus = svn_wc_status_none;\r
+                                       m_currentFullStatus = m_mostImportantFileStatus = git_wc_status_none;\r
                                        return CStatusCacheEntry();\r
                                }\r
                        }\r
                }\r
-               SVNPool subPool(CSVNStatusCache::Instance().m_svnHelp.Pool());\r
+//             SVNPool subPool(CGitStatusCache::Instance().m_svnHelp.Pool());\r
                {\r
                        AutoLocker lock(m_critSec);\r
-                       m_mostImportantFileStatus = svn_wc_status_none;\r
+                       m_mostImportantFileStatus = git_wc_status_none;\r
                        m_childDirectories.clear();\r
                        m_entryCache.clear();\r
                        m_ownStatus.SetStatus(NULL);\r
@@ -396,7 +396,9 @@ CStatusCacheEntry CCachedDirectory::GetStatusForMember(const CTSVNPath& path, bo
                                m_currentStatusFetchingPathTicks = GetTickCount();\r
                        }\r
                        ATLTRACE(_T("svn_cli_stat for '%s' (req %s)\n"), m_directoryPath.GetWinPath(), path.GetWinPath());\r
-                       svn_error_t* pErr = svn_client_status4 (\r
+                       git_error_t* pErr;\r
+#if 0\r
+                        = svn_client_status4 (\r
                                NULL,\r
                                m_directoryPath.GetSVNApiPath(subPool),\r
                                &revision,\r
@@ -408,9 +410,10 @@ CStatusCacheEntry CCachedDirectory::GetStatusForMember(const CTSVNPath& path, bo
                                TRUE,                                                                   //noignore\r
                                FALSE,                                                                  //ignore externals\r
                                NULL,                                                                   //changelists\r
-                               CSVNStatusCache::Instance().m_svnHelp.ClientContext(),\r
+                               CGitStatusCache::Instance().m_svnHelp.ClientContext(),\r
                                subPool\r
                                );\r
+#endif\r
                        {\r
                                AutoLocker pathlock(m_critSecPath);\r
                                m_currentStatusFetchingPath.Reset();\r
@@ -425,8 +428,8 @@ CStatusCacheEntry CCachedDirectory::GetStatusForMember(const CTSVNPath& path, bo
                                // If we allow ourselves to fall on through, then folders will be asked\r
                                // for their own status, and will set themselves as unversioned, for the \r
                                // benefit of future requests\r
-                               ATLTRACE("svn_cli_stat err: '%s'\n", pErr->message);\r
-                               svn_error_clear(pErr);\r
+//                             ATLTRACE("svn_cli_stat err: '%s'\n", pErr->message);\r
+//                             svn_error_clear(pErr);\r
                                // No assert here! Since we _can_ get here, an assertion is not an option!\r
                                // Reasons to get here: \r
                                // - renaming a folder with many sub folders --> results in "not a working copy" if the revert\r
@@ -434,7 +437,7 @@ CStatusCacheEntry CCachedDirectory::GetStatusForMember(const CTSVNPath& path, bo
                                // - reverting a move/copy --> results in "not a working copy" (as above)\r
                                if (!m_directoryPath.HasAdminDir())\r
                                {\r
-                                       m_currentFullStatus = m_mostImportantFileStatus = svn_wc_status_none;\r
+                                       m_currentFullStatus = m_mostImportantFileStatus = git_wc_status_none;\r
                                        return CStatusCacheEntry();\r
                                }\r
                                else\r
@@ -442,8 +445,8 @@ CStatusCacheEntry CCachedDirectory::GetStatusForMember(const CTSVNPath& path, bo
                                        ATLTRACE("svn_cli_stat error, assume none status\n");\r
                                        // Since we only assume a none status here due to svn_client_status()\r
                                        // returning an error, make sure that this status times out soon.\r
-                                       CSVNStatusCache::Instance().m_folderCrawler.BlockPath(m_directoryPath, 2000);\r
-                                       CSVNStatusCache::Instance().AddFolderForCrawling(m_directoryPath);\r
+                                       CGitStatusCache::Instance().m_folderCrawler.BlockPath(m_directoryPath, 2000);\r
+                                       CGitStatusCache::Instance().AddFolderForCrawling(m_directoryPath);\r
                                        return CStatusCacheEntry();\r
                                }\r
                        }\r
@@ -460,10 +463,10 @@ CStatusCacheEntry CCachedDirectory::GetStatusForMember(const CTSVNPath& path, bo
 \r
        if (path.IsDirectory())\r
        {\r
-               CCachedDirectory * dirEntry = CSVNStatusCache::Instance().GetDirectoryCacheEntry(path);\r
+               CCachedDirectory * dirEntry = CGitStatusCache::Instance().GetDirectoryCacheEntry(path);\r
                if ((dirEntry)&&(dirEntry->IsOwnStatusValid()))\r
                {\r
-                       CSVNStatusCache::Instance().AddFolderForCrawling(path);\r
+                       CGitStatusCache::Instance().AddFolderForCrawling(path);\r
                        return dirEntry->GetOwnStatus(bRecursive);\r
                }\r
 \r
@@ -471,7 +474,7 @@ CStatusCacheEntry CCachedDirectory::GetStatusForMember(const CTSVNPath& path, bo
                // the current directory is unversioned, and we shall need to ask its children for info about themselves\r
                if (dirEntry)\r
                        return dirEntry->GetStatusForMember(path,bRecursive);\r
-               CSVNStatusCache::Instance().AddFolderForCrawling(path);\r
+               CGitStatusCache::Instance().AddFolderForCrawling(path);\r
                return CStatusCacheEntry();\r
        }\r
        else\r
@@ -488,17 +491,17 @@ CStatusCacheEntry CCachedDirectory::GetStatusForMember(const CTSVNPath& path, bo
 }\r
 \r
 void \r
-CCachedDirectory::AddEntry(const CTSVNPath& path, const svn_wc_status2_t* pSVNStatus, DWORD validuntil /* = 0*/)\r
+CCachedDirectory::AddEntry(const CTGitPath& path, const git_wc_status2_t* pGitStatus, DWORD validuntil /* = 0*/)\r
 {\r
        AutoLocker lock(m_critSec);\r
        if(path.IsDirectory())\r
        {\r
-               CCachedDirectory * childDir = CSVNStatusCache::Instance().GetDirectoryCacheEntry(path);\r
+               CCachedDirectory * childDir = CGitStatusCache::Instance().GetDirectoryCacheEntry(path);\r
                if (childDir)\r
                {\r
-                       if ((childDir->GetCurrentFullStatus() != svn_wc_status_ignored)||(pSVNStatus==NULL)||(pSVNStatus->text_status != svn_wc_status_unversioned))\r
-                               childDir->m_ownStatus.SetStatus(pSVNStatus);\r
-                       childDir->m_ownStatus.SetKind(svn_node_dir);\r
+                       if ((childDir->GetCurrentFullStatus() != git_wc_status_missing)||(pGitStatus==NULL)||(pGitStatus->text_status != git_wc_status_unversioned))\r
+                               childDir->m_ownStatus.SetStatus(pGitStatus);\r
+//                     childDir->m_ownStatus.SetKind(svn_node_dir);\r
                }\r
        }\r
        else\r
@@ -507,12 +510,12 @@ CCachedDirectory::AddEntry(const CTSVNPath& path, const svn_wc_status2_t* pSVNSt
                CacheEntryMap::iterator entry_it = m_entryCache.lower_bound(cachekey);\r
                if (entry_it != m_entryCache.end() && entry_it->first == cachekey)\r
                {\r
-                       if (pSVNStatus)\r
+                       if (pGitStatus)\r
                        {\r
-                               if (entry_it->second.GetEffectiveStatus() > svn_wc_status_none &&\r
-                                       entry_it->second.GetEffectiveStatus() != SVNStatus::GetMoreImportant(pSVNStatus->prop_status, pSVNStatus->text_status))\r
+                               if (entry_it->second.GetEffectiveStatus() > git_wc_status_none &&\r
+                                       entry_it->second.GetEffectiveStatus() != GitStatus::GetMoreImportant(pGitStatus->prop_status, pGitStatus->text_status))\r
                                {\r
-                                       CSVNStatusCache::Instance().UpdateShell(path);\r
+                                       CGitStatusCache::Instance().UpdateShell(path);\r
                                        ATLTRACE(_T("shell update for %s\n"), path.GetWinPath());\r
                                }\r
                        }\r
@@ -521,13 +524,13 @@ CCachedDirectory::AddEntry(const CTSVNPath& path, const svn_wc_status2_t* pSVNSt
                {\r
                        entry_it = m_entryCache.insert(entry_it, std::make_pair(cachekey, CStatusCacheEntry()));\r
                }\r
-               entry_it->second = CStatusCacheEntry(pSVNStatus, path.GetLastWriteTime(), path.IsReadOnly(), validuntil);\r
+               entry_it->second = CStatusCacheEntry(pGitStatus, path.GetLastWriteTime(), path.IsReadOnly(), validuntil);\r
        }\r
 }\r
 \r
 \r
 CString \r
-CCachedDirectory::GetCacheKey(const CTSVNPath& path)\r
+CCachedDirectory::GetCacheKey(const CTGitPath& path)\r
 {\r
        // All we put into the cache as a key is just the end portion of the pathname\r
        // There's no point storing the path of the containing directory for every item\r
@@ -540,18 +543,19 @@ CCachedDirectory::GetFullPathString(const CString& cacheKey)
        return m_directoryPath.GetWinPathString() + _T("\\") + cacheKey;\r
 }\r
 \r
-svn_error_t * CCachedDirectory::GetStatusCallback(void *baton, const char *path, svn_wc_status2_t *status, apr_pool_t * /*pool*/)\r
+git_error_t * CCachedDirectory::GetStatusCallback(void *baton, const char *path, git_wc_status2_t *status)\r
 {\r
        CCachedDirectory* pThis = (CCachedDirectory*)baton;\r
 \r
        if (path == NULL)\r
-               return SVN_NO_ERROR;\r
+               return 0;\r
                \r
-       CTSVNPath svnPath;\r
+       CTGitPath svnPath;\r
 \r
+#if 0\r
        if(status->entry)\r
        {\r
-               if ((status->text_status != svn_wc_status_none)&&(status->text_status != svn_wc_status_ignored))\r
+               if ((status->text_status != git_wc_status_none)&&(status->text_status != git_wc_status_missing))\r
                        svnPath.SetFromSVN(path, (status->entry->kind == svn_node_dir));\r
                else\r
                        svnPath.SetFromSVN(path);\r
@@ -563,18 +567,18 @@ svn_error_t * CCachedDirectory::GetStatusCallback(void *baton, const char *path,
                                if (pThis->m_bRecursive)\r
                                {\r
                                        // Add any versioned directory, which is not our 'self' entry, to the list for having its status updated\r
-                                       CSVNStatusCache::Instance().AddFolderForCrawling(svnPath);\r
+                                       CGitStatusCache::Instance().AddFolderForCrawling(svnPath);\r
                                }\r
 \r
                                // Make sure we know about this child directory\r
                                // This initial status value is likely to be overwritten from below at some point\r
-                               svn_wc_status_kind s = SVNStatus::GetMoreImportant(status->text_status, status->prop_status);\r
-                               CCachedDirectory * cdir = CSVNStatusCache::Instance().GetDirectoryCacheEntryNoCreate(svnPath);\r
+                               git_wc_status_kind s = GitStatus::GetMoreImportant(status->text_status, status->prop_status);\r
+                               CCachedDirectory * cdir = CGitStatusCache::Instance().GetDirectoryCacheEntryNoCreate(svnPath);\r
                                if (cdir)\r
                                {\r
                                        // This child directory is already in our cache!\r
                                        // So ask this dir about its recursive status\r
-                                       svn_wc_status_kind st = SVNStatus::GetMoreImportant(s, cdir->GetCurrentFullStatus());\r
+                                       git_wc_status_kind st = GitStatus::GetMoreImportant(s, cdir->GetCurrentFullStatus());\r
                                        AutoLocker lock(pThis->m_critSec);\r
                                        pThis->m_childDirectories[svnPath] = st;\r
                                }\r
@@ -583,7 +587,7 @@ svn_error_t * CCachedDirectory::GetStatusCallback(void *baton, const char *path,
                                        // the child directory is not in the cache. Create a new entry for it in the cache which is\r
                                        // initially 'unversioned'. But we added that directory to the crawling list above, which\r
                                        // means the cache will be updated soon.\r
-                                       CSVNStatusCache::Instance().GetDirectoryCacheEntry(svnPath);\r
+                                       CGitStatusCache::Instance().GetDirectoryCacheEntry(svnPath);\r
                                        AutoLocker lock(pThis->m_critSec);\r
                                        pThis->m_childDirectories[svnPath] = s;\r
                                }\r
@@ -594,14 +598,14 @@ svn_error_t * CCachedDirectory::GetStatusCallback(void *baton, const char *path,
                        // Keep track of the most important status of all the files in this directory\r
                        // Don't include subdirectories in this figure, because they need to provide their \r
                        // own 'most important' value\r
-                       pThis->m_mostImportantFileStatus = SVNStatus::GetMoreImportant(pThis->m_mostImportantFileStatus, status->text_status);\r
-                       pThis->m_mostImportantFileStatus = SVNStatus::GetMoreImportant(pThis->m_mostImportantFileStatus, status->prop_status);\r
-                       if (((status->text_status == svn_wc_status_unversioned)||(status->text_status == svn_wc_status_none))\r
-                               &&(CSVNStatusCache::Instance().IsUnversionedAsModified()))\r
+                       pThis->m_mostImportantFileStatus = GitStatus::GetMoreImportant(pThis->m_mostImportantFileStatus, status->text_status);\r
+                       pThis->m_mostImportantFileStatus = GitStatus::GetMoreImportant(pThis->m_mostImportantFileStatus, status->prop_status);\r
+                       if (((status->text_status == git_wc_status_unversioned)||(status->text_status == git_wc_status_none))\r
+                               &&(CGitStatusCache::Instance().IsUnversionedAsModified()))\r
                        {\r
                                // treat unversioned files as modified\r
-                               if (pThis->m_mostImportantFileStatus != svn_wc_status_added)\r
-                                       pThis->m_mostImportantFileStatus = SVNStatus::GetMoreImportant(pThis->m_mostImportantFileStatus, svn_wc_status_modified);\r
+                               if (pThis->m_mostImportantFileStatus != git_wc_status_added)\r
+                                       pThis->m_mostImportantFileStatus = GitStatus::GetMoreImportant(pThis->m_mostImportantFileStatus, git_wc_status_modified);\r
                        }\r
                }\r
        }\r
@@ -612,59 +616,59 @@ svn_error_t * CCachedDirectory::GetStatusCallback(void *baton, const char *path,
                // part of another working copy (nested layouts).\r
                // So we have to make sure that such an 'unversioned' folder really\r
                // is unversioned.\r
-               if (((status->text_status == svn_wc_status_unversioned)||(status->text_status == svn_wc_status_ignored))&&(!svnPath.IsEquivalentToWithoutCase(pThis->m_directoryPath))&&(svnPath.IsDirectory()))\r
+               if (((status->text_status == git_wc_status_unversioned)||(status->text_status == git_wc_status_missing))&&(!svnPath.IsEquivalentToWithoutCase(pThis->m_directoryPath))&&(svnPath.IsDirectory()))\r
                {\r
                        if (svnPath.HasAdminDir())\r
                        {\r
-                               CSVNStatusCache::Instance().AddFolderForCrawling(svnPath);\r
+                               CGitStatusCache::Instance().AddFolderForCrawling(svnPath);\r
                                // Mark the directory as 'versioned' (status 'normal' for now).\r
                                // This initial value will be overwritten from below some time later\r
                                {\r
                                        AutoLocker lock(pThis->m_critSec);\r
-                                       pThis->m_childDirectories[svnPath] = svn_wc_status_normal;\r
+                                       pThis->m_childDirectories[svnPath] = git_wc_status_normal;\r
                                }\r
                                // Make sure the entry is also in the cache\r
-                               CSVNStatusCache::Instance().GetDirectoryCacheEntry(svnPath);\r
+                               CGitStatusCache::Instance().GetDirectoryCacheEntry(svnPath);\r
                                // also mark the status in the status object as normal\r
-                               status->text_status = svn_wc_status_normal;\r
+                               status->text_status = git_wc_status_normal;\r
                        }\r
                }\r
-               else if (status->text_status == svn_wc_status_external)\r
+               else if (status->text_status == git_wc_status_external)\r
                {\r
-                       CSVNStatusCache::Instance().AddFolderForCrawling(svnPath);\r
+                       CGitStatusCache::Instance().AddFolderForCrawling(svnPath);\r
                        // Mark the directory as 'versioned' (status 'normal' for now).\r
                        // This initial value will be overwritten from below some time later\r
                        {\r
                                AutoLocker lock(pThis->m_critSec);\r
-                               pThis->m_childDirectories[svnPath] = svn_wc_status_normal;\r
+                               pThis->m_childDirectories[svnPath] = git_wc_status_normal;\r
                        }\r
                        // we have added a directory to the child-directory list of this\r
                        // directory. We now must make sure that this directory also has\r
                        // an entry in the cache.\r
-                       CSVNStatusCache::Instance().GetDirectoryCacheEntry(svnPath);\r
+                       CGitStatusCache::Instance().GetDirectoryCacheEntry(svnPath);\r
                        // also mark the status in the status object as normal\r
-                       status->text_status = svn_wc_status_normal;\r
+                       status->text_status = git_wc_status_normal;\r
                }\r
                else\r
                {\r
                        if (svnPath.IsDirectory())\r
                        {\r
                                AutoLocker lock(pThis->m_critSec);\r
-                               pThis->m_childDirectories[svnPath] = SVNStatus::GetMoreImportant(status->text_status, status->prop_status);\r
+                               pThis->m_childDirectories[svnPath] = GitStatus::GetMoreImportant(status->text_status, status->prop_status);\r
                        }\r
-                       else if ((CSVNStatusCache::Instance().IsUnversionedAsModified())&&(status->text_status != svn_wc_status_ignored))\r
+                       else if ((CGitStatusCache::Instance().IsUnversionedAsModified())&&(status->text_status != git_wc_status_missing))\r
                        {\r
                                // make this unversioned item change the most important status of this\r
                                // folder to modified if it doesn't already have another status\r
-                               if (pThis->m_mostImportantFileStatus != svn_wc_status_added)\r
-                                       pThis->m_mostImportantFileStatus = SVNStatus::GetMoreImportant(pThis->m_mostImportantFileStatus, svn_wc_status_modified);\r
+                               if (pThis->m_mostImportantFileStatus != git_wc_status_added)\r
+                                       pThis->m_mostImportantFileStatus = GitStatus::GetMoreImportant(pThis->m_mostImportantFileStatus, git_wc_status_modified);\r
                        }\r
                }\r
        }\r
-\r
+#endif\r
        pThis->AddEntry(svnPath, status);\r
 \r
-       return SVN_NO_ERROR;\r
+       return 0;\r
 }\r
 \r
 bool \r
@@ -675,7 +679,7 @@ CCachedDirectory::IsOwnStatusValid() const
                   // 'external' isn't a valid status. That just\r
                   // means the folder is not part of the current working\r
                   // copy but it still has its own 'real' status\r
-                  m_ownStatus.GetEffectiveStatus()!=svn_wc_status_external &&\r
+                  m_ownStatus.GetEffectiveStatus()!=git_wc_status_external &&\r
                   m_ownStatus.IsKindKnown();\r
 }\r
 \r
@@ -684,15 +688,15 @@ void CCachedDirectory::Invalidate()
        m_ownStatus.Invalidate();\r
 }\r
 \r
-svn_wc_status_kind CCachedDirectory::CalculateRecursiveStatus()\r
+git_wc_status_kind CCachedDirectory::CalculateRecursiveStatus()\r
 {\r
        // Combine our OWN folder status with the most important of our *FILES'* status.\r
-       svn_wc_status_kind retVal = SVNStatus::GetMoreImportant(m_mostImportantFileStatus, m_ownStatus.GetEffectiveStatus());\r
+       git_wc_status_kind retVal = GitStatus::GetMoreImportant(m_mostImportantFileStatus, m_ownStatus.GetEffectiveStatus());\r
 \r
-       if ((retVal != svn_wc_status_modified)&&(retVal != m_ownStatus.GetEffectiveStatus()))\r
+       if ((retVal != git_wc_status_modified)&&(retVal != m_ownStatus.GetEffectiveStatus()))\r
        {\r
-               if ((retVal == svn_wc_status_added)||(retVal == svn_wc_status_deleted)||(retVal == svn_wc_status_missing))\r
-                       retVal = svn_wc_status_modified;\r
+               if ((retVal == git_wc_status_added)||(retVal == git_wc_status_deleted)||(retVal == git_wc_status_missing))\r
+                       retVal = git_wc_status_modified;\r
        }\r
 \r
        // Now combine all our child-directorie's status\r
@@ -701,11 +705,11 @@ svn_wc_status_kind CCachedDirectory::CalculateRecursiveStatus()
        ChildDirStatus::const_iterator it;\r
        for(it = m_childDirectories.begin(); it != m_childDirectories.end(); ++it)\r
        {\r
-               retVal = SVNStatus::GetMoreImportant(retVal, it->second);\r
-               if ((retVal != svn_wc_status_modified)&&(retVal != m_ownStatus.GetEffectiveStatus()))\r
+               retVal = GitStatus::GetMoreImportant(retVal, it->second);\r
+               if ((retVal != git_wc_status_modified)&&(retVal != m_ownStatus.GetEffectiveStatus()))\r
                {\r
-                       if ((retVal == svn_wc_status_added)||(retVal == svn_wc_status_deleted)||(retVal == svn_wc_status_missing))\r
-                               retVal = svn_wc_status_modified;\r
+                       if ((retVal == git_wc_status_added)||(retVal == git_wc_status_deleted)||(retVal == git_wc_status_missing))\r
+                               retVal = git_wc_status_modified;\r
                }\r
        }\r
        \r
@@ -715,31 +719,31 @@ svn_wc_status_kind CCachedDirectory::CalculateRecursiveStatus()
 // Update our composite status and deal with things if it's changed\r
 void CCachedDirectory::UpdateCurrentStatus()\r
 {\r
-       svn_wc_status_kind newStatus = CalculateRecursiveStatus();\r
+       git_wc_status_kind newStatus = CalculateRecursiveStatus();\r
 \r
        if ((newStatus != m_currentFullStatus)&&(m_ownStatus.IsVersioned()))\r
        {\r
-               if ((m_currentFullStatus != svn_wc_status_none)&&(m_ownStatus.GetEffectiveStatus() != svn_wc_status_ignored))\r
+               if ((m_currentFullStatus != git_wc_status_none)&&(m_ownStatus.GetEffectiveStatus() != git_wc_status_missing))\r
                {\r
                        // Our status has changed - tell the shell\r
                        ATLTRACE(_T("Dir %s, status change from %d to %d, send shell notification\n"), m_directoryPath.GetWinPath(), m_currentFullStatus, newStatus);           \r
-                       CSVNStatusCache::Instance().UpdateShell(m_directoryPath);\r
+                       CGitStatusCache::Instance().UpdateShell(m_directoryPath);\r
                }\r
-               if (m_ownStatus.GetEffectiveStatus() != svn_wc_status_ignored)\r
+               if (m_ownStatus.GetEffectiveStatus() != git_wc_status_missing)\r
                        m_currentFullStatus = newStatus;\r
                else\r
-                       m_currentFullStatus = svn_wc_status_ignored;\r
+                       m_currentFullStatus = git_wc_status_missing;\r
        }\r
        // And tell our parent, if we've got one...\r
        // we tell our parent *always* about our status, even if it hasn't\r
        // changed. This is to make sure that the parent has really our current\r
        // status - the parent can decide itself if our status has changed\r
        // or not.\r
-       CTSVNPath parentPath = m_directoryPath.GetContainingDirectory();\r
+       CTGitPath parentPath = m_directoryPath.GetContainingDirectory();\r
        if(!parentPath.IsEmpty())\r
        {\r
                // We have a parent\r
-               CCachedDirectory * cachedDir = CSVNStatusCache::Instance().GetDirectoryCacheEntry(parentPath);\r
+               CCachedDirectory * cachedDir = CGitStatusCache::Instance().GetDirectoryCacheEntry(parentPath);\r
                if (cachedDir)\r
                        cachedDir->UpdateChildDirectoryStatus(m_directoryPath, m_currentFullStatus);\r
        }\r
@@ -747,9 +751,9 @@ void CCachedDirectory::UpdateCurrentStatus()
 \r
 \r
 // Receive a notification from a child that its status has changed\r
-void CCachedDirectory::UpdateChildDirectoryStatus(const CTSVNPath& childDir, svn_wc_status_kind childStatus)\r
+void CCachedDirectory::UpdateChildDirectoryStatus(const CTGitPath& childDir, git_wc_status_kind childStatus)\r
 {\r
-       svn_wc_status_kind currentStatus = svn_wc_status_none;\r
+       git_wc_status_kind currentStatus = git_wc_status_none;\r
        {\r
                AutoLocker lock(m_critSec);\r
                currentStatus = m_childDirectories[childDir];\r
@@ -767,7 +771,7 @@ void CCachedDirectory::UpdateChildDirectoryStatus(const CTSVNPath& childDir, svn
 CStatusCacheEntry CCachedDirectory::GetOwnStatus(bool bRecursive)\r
 {\r
        // Don't return recursive status if we're unversioned ourselves.\r
-       if(bRecursive && m_ownStatus.GetEffectiveStatus() > svn_wc_status_unversioned)\r
+       if(bRecursive && m_ownStatus.GetEffectiveStatus() > git_wc_status_unversioned)\r
        {\r
                CStatusCacheEntry recursiveStatus(m_ownStatus);\r
                UpdateCurrentStatus();\r
@@ -788,7 +792,7 @@ void CCachedDirectory::RefreshStatus(bool bRecursive)
        AutoLocker lock(m_critSec);\r
        // We also need to check if all our file members have the right date on them\r
        CacheEntryMap::iterator itMembers;\r
-       std::set<CTSVNPath> refreshedpaths;\r
+       std::set<CTGitPath> refreshedpaths;\r
        DWORD now = GetTickCount();\r
        if (m_entryCache.size() == 0)\r
                return;\r
@@ -796,9 +800,9 @@ void CCachedDirectory::RefreshStatus(bool bRecursive)
        {\r
                if (itMembers->first)\r
                {\r
-                       CTSVNPath filePath(m_directoryPath);\r
+                       CTGitPath filePath(m_directoryPath);\r
                        filePath.AppendPathString(itMembers->first);\r
-                       std::set<CTSVNPath>::iterator refr_it;\r
+                       std::set<CTGitPath>::iterator refr_it;\r
                        if ((!filePath.IsEquivalentToWithoutCase(m_directoryPath))&&\r
                                (((refr_it = refreshedpaths.lower_bound(filePath)) == refreshedpaths.end()) || !filePath.IsEquivalentToWithoutCase(*refr_it)))\r
                        {\r
@@ -822,7 +826,7 @@ void CCachedDirectory::RefreshStatus(bool bRecursive)
                                {\r
                                        // crawl all sub folders too! Otherwise a change deep inside the\r
                                        // tree which has changed won't get propagated up the tree.\r
-                                       CSVNStatusCache::Instance().AddFolderForCrawling(filePath);\r
+                                       CGitStatusCache::Instance().AddFolderForCrawling(filePath);\r
                                }\r
                        }\r
                }\r
@@ -832,22 +836,22 @@ void CCachedDirectory::RefreshStatus(bool bRecursive)
 void CCachedDirectory::RefreshMostImportant()\r
 {\r
        CacheEntryMap::iterator itMembers;\r
-       svn_wc_status_kind newStatus = m_ownStatus.GetEffectiveStatus();\r
+       git_wc_status_kind newStatus = m_ownStatus.GetEffectiveStatus();\r
        for (itMembers = m_entryCache.begin(); itMembers != m_entryCache.end(); ++itMembers)\r
        {\r
-               newStatus = SVNStatus::GetMoreImportant(newStatus, itMembers->second.GetEffectiveStatus());\r
-               if (((itMembers->second.GetEffectiveStatus() == svn_wc_status_unversioned)||(itMembers->second.GetEffectiveStatus() == svn_wc_status_none))\r
-                       &&(CSVNStatusCache::Instance().IsUnversionedAsModified()))\r
+               newStatus = GitStatus::GetMoreImportant(newStatus, itMembers->second.GetEffectiveStatus());\r
+               if (((itMembers->second.GetEffectiveStatus() == git_wc_status_unversioned)||(itMembers->second.GetEffectiveStatus() == git_wc_status_none))\r
+                       &&(CGitStatusCache::Instance().IsUnversionedAsModified()))\r
                {\r
                        // treat unversioned files as modified\r
-                       if (newStatus != svn_wc_status_added)\r
-                               newStatus = SVNStatus::GetMoreImportant(newStatus, svn_wc_status_modified);\r
+                       if (newStatus != git_wc_status_added)\r
+                               newStatus = GitStatus::GetMoreImportant(newStatus, git_wc_status_modified);\r
                }\r
        }\r
        if (newStatus != m_mostImportantFileStatus)\r
        {\r
                ATLTRACE(_T("status change of path %s\n"), m_directoryPath.GetWinPath());\r
-               CSVNStatusCache::Instance().UpdateShell(m_directoryPath);\r
+               CGitStatusCache::Instance().UpdateShell(m_directoryPath);\r
        }\r
        m_mostImportantFileStatus = newStatus;\r
 }\r
index 08e76cc..987c0d0 100644 (file)
 class CCachedDirectory\r
 {\r
 public:\r
-       typedef std::map<CTSVNPath, CCachedDirectory *> CachedDirMap; \r
+       typedef std::map<CTGitPath, CCachedDirectory *> CachedDirMap; \r
        typedef CachedDirMap::iterator ItDir;\r
 \r
 public:\r
 \r
        CCachedDirectory();\r
-       CCachedDirectory(const CTSVNPath& directoryPath);\r
+       CCachedDirectory(const CTGitPath& directoryPath);\r
        ~CCachedDirectory(void);\r
-       CStatusCacheEntry GetStatusForMember(const CTSVNPath& path, bool bRecursive, bool bFetch = true);\r
+       CStatusCacheEntry GetStatusForMember(const CTGitPath& path, bool bRecursive, bool bFetch = true);\r
        CStatusCacheEntry GetOwnStatus(bool bRecursive);\r
        bool IsOwnStatusValid() const;\r
        void Invalidate();\r
@@ -46,17 +46,17 @@ public:
        BOOL SaveToDisk(FILE * pFile);\r
        BOOL LoadFromDisk(FILE * pFile);\r
        /// Get the current full status of this folder\r
-       svn_wc_status_kind GetCurrentFullStatus() {return m_currentFullStatus;}\r
+       git_wc_status_kind GetCurrentFullStatus() {return m_currentFullStatus;}\r
 private:\r
-       static svn_error_t* GetStatusCallback(void *baton, const char *path, svn_wc_status2_t *status, apr_pool_t *pool);\r
-       void AddEntry(const CTSVNPath& path, const svn_wc_status2_t* pSVNStatus, DWORD validuntil = 0);\r
-       CString GetCacheKey(const CTSVNPath& path);\r
+       static git_error_t* GetStatusCallback(void *baton, const char *path, git_wc_status2_t *status);\r
+       void AddEntry(const CTGitPath& path, const git_wc_status2_t* pGitStatus, DWORD validuntil = 0);\r
+       CString GetCacheKey(const CTGitPath& path);\r
        CString GetFullPathString(const CString& cacheKey);\r
-       CStatusCacheEntry LookForItemInCache(const CTSVNPath& path, bool &bFound);\r
-       void UpdateChildDirectoryStatus(const CTSVNPath& childDir, svn_wc_status_kind childStatus);\r
+       CStatusCacheEntry LookForItemInCache(const CTGitPath& path, bool &bFound);\r
+       void UpdateChildDirectoryStatus(const CTGitPath& childDir, git_wc_status_kind childStatus);\r
 \r
        // Calculate the complete, composite status from ourselves, our files, and our descendants\r
-       svn_wc_status_kind CalculateRecursiveStatus();\r
+       git_wc_status_kind CalculateRecursiveStatus();\r
 \r
        // Update our composite status and deal with things if it's changed\r
        void UpdateCurrentStatus();\r
@@ -66,14 +66,14 @@ private:
        CComAutoCriticalSection m_critSec;\r
        CComAutoCriticalSection m_critSecPath;\r
 \r
-       CTSVNPath       m_currentStatusFetchingPath;\r
+       CTGitPath       m_currentStatusFetchingPath;\r
        DWORD           m_currentStatusFetchingPathTicks;\r
        // The cache of files and directories within this directory\r
        typedef std::map<CString, CStatusCacheEntry> CacheEntryMap; \r
        CacheEntryMap m_entryCache; \r
 \r
        /// A vector if iterators to child directories - used to put-together recursive status\r
-       typedef std::map<CTSVNPath, svn_wc_status_kind>  ChildDirStatus;\r
+       typedef std::map<CTGitPath, git_wc_status_kind>  ChildDirStatus;\r
        ChildDirStatus m_childDirectories;\r
 \r
        // The timestamp of the .SVN\entries file.  For an unversioned directory, this will be zero\r
@@ -82,19 +82,19 @@ private:
        __int64 m_propsFileTime;\r
        \r
        // The path of the directory with this object looks after\r
-       CTSVNPath       m_directoryPath;\r
+       CTGitPath       m_directoryPath;\r
 \r
        // The status of THIS directory (not a composite of children or members)\r
        CStatusCacheEntry m_ownStatus;\r
 \r
        // Our current fully recursive status\r
-       svn_wc_status_kind  m_currentFullStatus;\r
+       git_wc_status_kind  m_currentFullStatus;\r
        bool m_bCurrentFullStatusValid;\r
 \r
        // The most important status from all our file entries\r
-       svn_wc_status_kind m_mostImportantFileStatus;\r
+       git_wc_status_kind m_mostImportantFileStatus;\r
 \r
        bool m_bRecursive;              // used in the status callback\r
-       friend class CSVNStatusCache;           \r
+       friend class CGitStatusCache;           \r
 };\r
 \r
index d15094d..a2cdfb2 100644 (file)
@@ -18,7 +18,7 @@
 //\r
 #include "StdAfx.h"\r
 #include "Dbt.h"\r
-#include "SVNStatusCache.h"\r
+#include "GitStatusCache.h"\r
 #include ".\directorywatcher.h"\r
 \r
 extern HWND hWnd;\r
@@ -84,7 +84,7 @@ void CDirectoryWatcher::SetFolderCrawler(CFolderCrawler * crawler)
        m_FolderCrawler = crawler;\r
 }\r
 \r
-bool CDirectoryWatcher::RemovePathAndChildren(const CTSVNPath& path)\r
+bool CDirectoryWatcher::RemovePathAndChildren(const CTGitPath& path)\r
 {\r
        bool bRemoved = false;\r
        AutoLocker lock(m_critSec);\r
@@ -101,7 +101,7 @@ repeat:
        return bRemoved;\r
 }\r
 \r
-void CDirectoryWatcher::BlockPath(const CTSVNPath& path)\r
+void CDirectoryWatcher::BlockPath(const CTGitPath& path)\r
 {\r
        blockedPath = path;\r
        // block the path from being watched for 4 seconds\r
@@ -109,9 +109,9 @@ void CDirectoryWatcher::BlockPath(const CTSVNPath& path)
        ATLTRACE(_T("Blocking path: %s\n"), path.GetWinPath());\r
 }\r
 \r
-bool CDirectoryWatcher::AddPath(const CTSVNPath& path)\r
+bool CDirectoryWatcher::AddPath(const CTGitPath& path)\r
 {\r
-       if (!CSVNStatusCache::Instance().IsPathAllowed(path))\r
+       if (!CGitStatusCache::Instance().IsPathAllowed(path))\r
                return false;\r
        if ((!blockedPath.IsEmpty())&&(blockedPath.IsAncestorOf(path)))\r
        {\r
@@ -129,7 +129,7 @@ bool CDirectoryWatcher::AddPath(const CTSVNPath& path)
        }\r
        \r
        // now check if with the new path we might have a new root\r
-       CTSVNPath newroot;\r
+       CTGitPath newroot;\r
        for (int i=0; i<watchedPaths.GetCount(); ++i)\r
        {\r
                const CString& watched = watchedPaths[i].GetWinPathString();\r
@@ -144,11 +144,11 @@ bool CDirectoryWatcher::AddPath(const CTSVNPath& path)
                                {\r
                                        if (sPath.GetAt(len)=='\\')\r
                                        {\r
-                                               newroot = CTSVNPath(sPath.Left(len));\r
+                                               newroot = CTGitPath(sPath.Left(len));\r
                                        }\r
                                        else if (watched.GetAt(len)=='\\')\r
                                        {\r
-                                               newroot = CTSVNPath(watched.Left(len));\r
+                                               newroot = CTGitPath(watched.Left(len));\r
                                        }\r
                                }\r
                                break;\r
@@ -176,11 +176,11 @@ bool CDirectoryWatcher::AddPath(const CTSVNPath& path)
                                {\r
                                        if (sPath.GetAt(len)=='\\')\r
                                        {\r
-                                               newroot = CTSVNPath(watched);\r
+                                               newroot = CTGitPath(watched);\r
                                        }\r
                                        else if (watched.GetLength() == 3 && watched[1] == ':')\r
                                        {\r
-                                               newroot = CTSVNPath(watched);\r
+                                               newroot = CTGitPath(watched);\r
                                        }\r
                                }\r
                        }\r
@@ -202,7 +202,7 @@ bool CDirectoryWatcher::AddPath(const CTSVNPath& path)
        return true;\r
 }\r
 \r
-bool CDirectoryWatcher::IsPathWatched(const CTSVNPath& path)\r
+bool CDirectoryWatcher::IsPathWatched(const CTGitPath& path)\r
 {\r
        for (int i=0; i<watchedPaths.GetCount(); ++i)\r
        {\r
@@ -255,7 +255,7 @@ void CDirectoryWatcher::WorkerThread()
                                m_hCompPort = NULL;\r
                                for (int i=0; i<watchedPaths.GetCount(); ++i)\r
                                {\r
-                                       CTSVNPath watchedPath = watchedPaths[i];\r
+                                       CTGitPath watchedPath = watchedPaths[i];\r
 \r
                                        HANDLE hDir = CreateFile(watchedPath.GetWinPath(), \r
                                                                                        FILE_LIST_DIRECTORY, \r
@@ -394,7 +394,7 @@ void CDirectoryWatcher::WorkerThread()
                                                                continue;\r
                                                        }\r
                                                        ATLTRACE(_T("change notification: %s\n"), buf);\r
-                                                       m_FolderCrawler->AddPathForUpdate(CTSVNPath(buf));\r
+                                                       m_FolderCrawler->AddPathForUpdate(CTGitPath(buf));\r
                                                }\r
                                                if ((ULONG_PTR)pnotify - (ULONG_PTR)pdi->m_Buffer > READ_DIR_CHANGE_BUFFER_SIZE)\r
                                                        break;\r
@@ -443,9 +443,9 @@ void CDirectoryWatcher::ClearInfoMap()
        m_hCompPort = INVALID_HANDLE_VALUE;\r
 }\r
 \r
-CTSVNPath CDirectoryWatcher::CloseInfoMap(HDEVNOTIFY hdev)\r
+CTGitPath CDirectoryWatcher::CloseInfoMap(HDEVNOTIFY hdev)\r
 {\r
-       CTSVNPath path;\r
+       CTGitPath path;\r
        if (watchInfoMap.size() == 0)\r
                return path;\r
        AutoLocker lock(m_critSec);\r
@@ -467,7 +467,7 @@ CTSVNPath CDirectoryWatcher::CloseInfoMap(HDEVNOTIFY hdev)
        return path;\r
 }\r
 \r
-bool CDirectoryWatcher::CloseHandlesForPath(const CTSVNPath& path)\r
+bool CDirectoryWatcher::CloseHandlesForPath(const CTGitPath& path)\r
 {\r
        if (watchInfoMap.size() == 0)\r
                return false;\r
@@ -475,7 +475,7 @@ bool CDirectoryWatcher::CloseHandlesForPath(const CTSVNPath& path)
        for (std::map<HANDLE, CDirWatchInfo *>::iterator I = watchInfoMap.begin(); I != watchInfoMap.end(); ++I)\r
        {\r
                CDirectoryWatcher::CDirWatchInfo * info = I->second;\r
-               CTSVNPath p = CTSVNPath(info->m_DirPath);\r
+               CTGitPath p = CTGitPath(info->m_DirPath);\r
                if (path.IsAncestorOf(p))\r
                {\r
                        RemovePathAndChildren(p);\r
@@ -490,7 +490,7 @@ bool CDirectoryWatcher::CloseHandlesForPath(const CTSVNPath& path)
        return true;\r
 }\r
 \r
-CDirectoryWatcher::CDirWatchInfo::CDirWatchInfo(HANDLE hDir, const CTSVNPath& DirectoryName) :\r
+CDirectoryWatcher::CDirWatchInfo::CDirWatchInfo(HANDLE hDir, const CTGitPath& DirectoryName) :\r
        m_hDir(hDir),\r
        m_DirName(DirectoryName)\r
 {\r
index 08ca63f..a26f741 100644 (file)
@@ -17,7 +17,7 @@
 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\r
 //\r
 #pragma once\r
-#include "TSVNPath.h"\r
+#include "TGitPath.h"\r
 #include "FolderCrawler.h"\r
 #include "ShellCache.h"\r
 \r
@@ -37,7 +37,7 @@
  * children of already watched folders are automatically removed from watching.\r
  * This leads to having only the roots of file systems watched (e.g. C:\, D:\,...)\r
  * after a few paths have been added to the watched list (at least, when the\r
- * CSVNStatusCache adds those paths).\r
+ * CGitStatusCache adds those paths).\r
  */\r
 class CDirectoryWatcher\r
 {\r
@@ -51,15 +51,15 @@ public:
         * watched recursively, then the new path is just ignored and the method\r
         * returns false.\r
         */\r
-       bool AddPath(const CTSVNPath& path);\r
+       bool AddPath(const CTGitPath& path);\r
        /**\r
         * Removes a path and all its children from the watched list.\r
         */\r
-       bool RemovePathAndChildren(const CTSVNPath& path);\r
+       bool RemovePathAndChildren(const CTGitPath& path);\r
        /**\r
         * Checks if a path is watched\r
         */\r
-       bool IsPathWatched(const CTSVNPath& path);\r
+       bool IsPathWatched(const CTGitPath& path);\r
        \r
        /**\r
         * Returns the number of recursively watched paths.\r
@@ -76,8 +76,8 @@ public:
         */\r
        void Stop();\r
 \r
-       CTSVNPath CloseInfoMap(HDEVNOTIFY hdev = INVALID_HANDLE_VALUE);\r
-       bool CloseHandlesForPath(const CTSVNPath& path);\r
+       CTGitPath CloseInfoMap(HDEVNOTIFY hdev = INVALID_HANDLE_VALUE);\r
+       bool CloseHandlesForPath(const CTGitPath& path);\r
 \r
 private:\r
        static unsigned int __stdcall ThreadEntry(void* pContext);\r
@@ -85,7 +85,7 @@ private:
 \r
        void ClearInfoMap();\r
 \r
-       void BlockPath(const CTSVNPath& path);\r
+       void BlockPath(const CTGitPath& path);\r
 \r
 private:\r
        CComAutoCriticalSection m_critSec;\r
@@ -95,9 +95,9 @@ private:
 \r
        CFolderCrawler *                m_FolderCrawler;        ///< where the change reports go to\r
        \r
-       CTSVNPathList                   watchedPaths;   ///< list of watched paths.\r
+       CTGitPathList                   watchedPaths;   ///< list of watched paths.\r
 \r
-       CTSVNPath                               blockedPath;\r
+       CTGitPath                               blockedPath;\r
        DWORD                                   blockTickCount;\r
 \r
        /**\r
@@ -110,7 +110,7 @@ private:
                CDirWatchInfo();        // private & not implemented\r
                CDirWatchInfo & operator=(const CDirWatchInfo & rhs);//so that they're aren't accidentally used. -- you'll get a linker error\r
        public:\r
-               CDirWatchInfo(HANDLE hDir, const CTSVNPath& DirectoryName);\r
+               CDirWatchInfo(HANDLE hDir, const CTGitPath& DirectoryName);\r
                ~CDirWatchInfo();\r
 \r
        protected:\r
@@ -118,7 +118,7 @@ private:
                bool    CloseDirectoryHandle();\r
 \r
                HANDLE          m_hDir;                 ///< handle to the directory that we're watching\r
-               CTSVNPath       m_DirName;              ///< the directory that we're watching\r
+               CTGitPath       m_DirName;              ///< the directory that we're watching\r
                CHAR            m_Buffer[READ_DIR_CHANGE_BUFFER_SIZE]; ///< buffer for ReadDirectoryChangesW\r
                DWORD           m_dwBufLength;  ///< length or returned data from ReadDirectoryChangesW -- ignored?...\r
                OVERLAPPED  m_Overlapped;\r
index f1033be..d4e4e24 100644 (file)
@@ -19,7 +19,7 @@
 \r
 #include "StdAfx.h"\r
 #include ".\foldercrawler.h"\r
-#include "SVNStatusCache.h"\r
+#include "GitStatusCache.h"\r
 #include "registry.h"\r
 #include "TSVNCache.h"\r
 #include "shlobj.h"\r
@@ -77,9 +77,9 @@ void CFolderCrawler::Initialise()
        SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_IDLE);\r
 }\r
 \r
-void CFolderCrawler::AddDirectoryForUpdate(const CTSVNPath& path)\r
+void CFolderCrawler::AddDirectoryForUpdate(const CTGitPath& path)\r
 {\r
-       if (!CSVNStatusCache::Instance().IsPathGood(path))\r
+       if (!CGitStatusCache::Instance().IsPathGood(path))\r
                return;\r
        {\r
                AutoLocker lock(m_critSec);\r
@@ -94,9 +94,9 @@ void CFolderCrawler::AddDirectoryForUpdate(const CTSVNPath& path)
                SetEvent(m_hWakeEvent);\r
 }\r
 \r
-void CFolderCrawler::AddPathForUpdate(const CTSVNPath& path)\r
+void CFolderCrawler::AddPathForUpdate(const CTGitPath& path)\r
 {\r
-       if (!CSVNStatusCache::Instance().IsPathGood(path))\r
+       if (!CGitStatusCache::Instance().IsPathGood(path))\r
                return;\r
        {\r
                AutoLocker lock(m_critSec);\r
@@ -119,7 +119,7 @@ void CFolderCrawler::WorkerThread()
        HANDLE hWaitHandles[2];\r
        hWaitHandles[0] = m_hTerminationEvent;  \r
        hWaitHandles[1] = m_hWakeEvent;\r
-       CTSVNPath workingPath;\r
+       CTGitPath workingPath;\r
        bool bFirstRunAfterWakeup = false;\r
        DWORD currentTicks = 0;\r
 \r
@@ -164,12 +164,12 @@ void CFolderCrawler::WorkerThread()
                        if (!m_bRun)\r
                                break;\r
                        // Any locks today?\r
-                       if (CSVNStatusCache::Instance().m_bClearMemory)\r
+                       if (CGitStatusCache::Instance().m_bClearMemory)\r
                        {\r
-                               CSVNStatusCache::Instance().WaitToWrite();\r
-                               CSVNStatusCache::Instance().ClearCache();\r
-                               CSVNStatusCache::Instance().Done();\r
-                               CSVNStatusCache::Instance().m_bClearMemory = false;\r
+                               CGitStatusCache::Instance().WaitToWrite();\r
+                               CGitStatusCache::Instance().ClearCache();\r
+                               CGitStatusCache::Instance().Done();\r
+                               CGitStatusCache::Instance().m_bClearMemory = false;\r
                        }\r
                        if(m_lCrawlInhibitSet > 0)\r
                        {\r
@@ -205,7 +205,7 @@ void CFolderCrawler::WorkerThread()
                                        {\r
                                                // The queue has changed - it's worth sorting and de-duping\r
                                                std::sort(m_pathsToUpdate.begin(), m_pathsToUpdate.end());\r
-                                               m_pathsToUpdate.erase(std::unique(m_pathsToUpdate.begin(), m_pathsToUpdate.end(), &CTSVNPath::PredLeftSameWCPathAsRight), m_pathsToUpdate.end());\r
+                                               m_pathsToUpdate.erase(std::unique(m_pathsToUpdate.begin(), m_pathsToUpdate.end(), &CTGitPath::PredLeftSameWCPathAsRight), m_pathsToUpdate.end());\r
                                                m_bPathsAddedSinceLastCrawl = false;\r
                                        }\r
                                        workingPath = m_pathsToUpdate.front();\r
@@ -219,7 +219,7 @@ void CFolderCrawler::WorkerThread()
                                                // to crawl. That way, we still reduce the size of the list.\r
                                                if (m_pathsToUpdate.size() > 10)\r
                                                        ATLTRACE("attention: the list of paths to update is now %ld big!\n", m_pathsToUpdate.size());\r
-                                               for (std::deque<CTSVNPath>::iterator it = m_pathsToUpdate.begin(); it != m_pathsToUpdate.end(); ++it)\r
+                                               for (std::deque<CTGitPath>::iterator it = m_pathsToUpdate.begin(); it != m_pathsToUpdate.end(); ++it)\r
                                                {\r
                                                        workingPath = *it;\r
                                                        if ((DWORD(workingPath.GetCustomData()) < currentTicks)||(DWORD(workingPath.GetCustomData()) > (currentTicks + 200000)))\r
@@ -238,7 +238,7 @@ void CFolderCrawler::WorkerThread()
                                if ((!m_blockedPath.IsEmpty())&&(m_blockedPath.IsAncestorOf(workingPath)))\r
                                        continue;\r
                                // don't crawl paths that are excluded\r
-                               if (!CSVNStatusCache::Instance().IsPathAllowed(workingPath))\r
+                               if (!CGitStatusCache::Instance().IsPathAllowed(workingPath))\r
                                        continue;\r
                                // check if the changed path is inside an .svn folder\r
                                if ((workingPath.HasAdminDir()&&workingPath.IsDirectory())||workingPath.IsAdminDir())\r
@@ -270,9 +270,9 @@ void CFolderCrawler::WorkerThread()
                                        }\r
                                        else if (!workingPath.Exists())\r
                                        {\r
-                                               CSVNStatusCache::Instance().WaitToWrite();\r
-                                               CSVNStatusCache::Instance().RemoveCacheForPath(workingPath);\r
-                                               CSVNStatusCache::Instance().Done();\r
+                                               CGitStatusCache::Instance().WaitToWrite();\r
+                                               CGitStatusCache::Instance().RemoveCacheForPath(workingPath);\r
+                                               CGitStatusCache::Instance().Done();\r
                                                continue;\r
                                        }\r
 \r
@@ -290,12 +290,12 @@ void CFolderCrawler::WorkerThread()
                                                        nCurrentCrawledpathIndex = 0;\r
                                        }\r
                                        InvalidateRect(hWnd, NULL, FALSE);\r
-                                       CSVNStatusCache::Instance().WaitToRead();\r
+                                       CGitStatusCache::Instance().WaitToRead();\r
                                        // Invalidate the cache of this folder, to make sure its status is fetched again.\r
-                                       CCachedDirectory * pCachedDir = CSVNStatusCache::Instance().GetDirectoryCacheEntry(workingPath);\r
+                                       CCachedDirectory * pCachedDir = CGitStatusCache::Instance().GetDirectoryCacheEntry(workingPath);\r
                                        if (pCachedDir)\r
                                        {\r
-                                               svn_wc_status_kind status = pCachedDir->GetCurrentFullStatus();\r
+                                               git_wc_status_kind status = pCachedDir->GetCurrentFullStatus();\r
                                                pCachedDir->Invalidate();\r
                                                if (workingPath.Exists())\r
                                                {\r
@@ -305,20 +305,20 @@ void CFolderCrawler::WorkerThread()
                                                        // We do this here because GetCurrentFullStatus() doesn't send\r
                                                        // notifications for 'normal' status - if it would, we'd get tons\r
                                                        // of notifications when crawling a working copy not yet in the cache.\r
-                                                       if ((status != svn_wc_status_normal)&&(pCachedDir->GetCurrentFullStatus() != status))\r
+                                                       if ((status != git_wc_status_normal)&&(pCachedDir->GetCurrentFullStatus() != status))\r
                                                        {\r
-                                                               CSVNStatusCache::Instance().UpdateShell(workingPath);\r
+                                                               CGitStatusCache::Instance().UpdateShell(workingPath);\r
                                                                ATLTRACE(_T("shell update in crawler for %s\n"), workingPath.GetWinPath());\r
                                                        }\r
                                                }\r
                                                else\r
                                                {\r
-                                                       CSVNStatusCache::Instance().Done();\r
-                                                       CSVNStatusCache::Instance().WaitToWrite();\r
-                                                       CSVNStatusCache::Instance().RemoveCacheForPath(workingPath);\r
+                                                       CGitStatusCache::Instance().Done();\r
+                                                       CGitStatusCache::Instance().WaitToWrite();\r
+                                                       CGitStatusCache::Instance().RemoveCacheForPath(workingPath);\r
                                                }\r
                                        }\r
-                                       CSVNStatusCache::Instance().Done();\r
+                                       CGitStatusCache::Instance().Done();\r
                                        //In case that svn_client_stat() modified a file and we got\r
                                        //a notification about that in the directory watcher,\r
                                        //remove that here again - this is to prevent an endless loop\r
@@ -329,9 +329,9 @@ void CFolderCrawler::WorkerThread()
                                {\r
                                        if (!workingPath.Exists())\r
                                        {\r
-                                               CSVNStatusCache::Instance().WaitToWrite();\r
-                                               CSVNStatusCache::Instance().RemoveCacheForPath(workingPath);\r
-                                               CSVNStatusCache::Instance().Done();\r
+                                               CGitStatusCache::Instance().WaitToWrite();\r
+                                               CGitStatusCache::Instance().RemoveCacheForPath(workingPath);\r
+                                               CGitStatusCache::Instance().Done();\r
                                                continue;\r
                                        }\r
                                        if (!workingPath.Exists())\r
@@ -349,23 +349,23 @@ void CFolderCrawler::WorkerThread()
                                        DWORD flags = TSVNCACHE_FLAGS_FOLDERISKNOWN;\r
                                        flags |= (workingPath.IsDirectory() ? TSVNCACHE_FLAGS_ISFOLDER : 0);\r
                                        flags |= (bRecursive ? TSVNCACHE_FLAGS_RECUSIVE_STATUS : 0);\r
-                                       CSVNStatusCache::Instance().WaitToRead();\r
+                                       CGitStatusCache::Instance().WaitToRead();\r
                                        // Invalidate the cache of folders manually. The cache of files is invalidated\r
                                        // automatically if the status is asked for it and the file times don't match\r
                                        // anymore, so we don't need to manually invalidate those.\r
                                        if (workingPath.IsDirectory())\r
                                        {\r
-                                               CCachedDirectory * cachedDir = CSVNStatusCache::Instance().GetDirectoryCacheEntry(workingPath);\r
+                                               CCachedDirectory * cachedDir = CGitStatusCache::Instance().GetDirectoryCacheEntry(workingPath);\r
                                                if (cachedDir)\r
                                                        cachedDir->Invalidate();\r
                                        }\r
-                                       CStatusCacheEntry ce = CSVNStatusCache::Instance().GetStatusForPath(workingPath, flags);\r
-                                       if (ce.GetEffectiveStatus() > svn_wc_status_unversioned)\r
+                                       CStatusCacheEntry ce = CGitStatusCache::Instance().GetStatusForPath(workingPath, flags);\r
+                                       if (ce.GetEffectiveStatus() > git_wc_status_unversioned)\r
                                        {\r
-                                               CSVNStatusCache::Instance().UpdateShell(workingPath);\r
+                                               CGitStatusCache::Instance().UpdateShell(workingPath);\r
                                                ATLTRACE(_T("shell update in folder crawler for %s\n"), workingPath.GetWinPath());\r
                                        }\r
-                                       CSVNStatusCache::Instance().Done();\r
+                                       CGitStatusCache::Instance().Done();\r
                                        AutoLocker lock(m_critSec);\r
                                        m_pathsToUpdate.erase(std::remove(m_pathsToUpdate.begin(), m_pathsToUpdate.end(), workingPath), m_pathsToUpdate.end());\r
                                }\r
@@ -373,9 +373,9 @@ void CFolderCrawler::WorkerThread()
                                {\r
                                        if (!workingPath.Exists())\r
                                        {\r
-                                               CSVNStatusCache::Instance().WaitToWrite();\r
-                                               CSVNStatusCache::Instance().RemoveCacheForPath(workingPath);\r
-                                               CSVNStatusCache::Instance().Done();\r
+                                               CGitStatusCache::Instance().WaitToWrite();\r
+                                               CGitStatusCache::Instance().RemoveCacheForPath(workingPath);\r
+                                               CGitStatusCache::Instance().Done();\r
                                        }\r
                                }\r
                        }\r
@@ -388,13 +388,13 @@ void CFolderCrawler::WorkerThread()
                                        {\r
                                                // The queue has changed - it's worth sorting and de-duping\r
                                                std::sort(m_foldersToUpdate.begin(), m_foldersToUpdate.end());\r
-                                               m_foldersToUpdate.erase(std::unique(m_foldersToUpdate.begin(), m_foldersToUpdate.end(), &CTSVNPath::PredLeftEquivalentToRight), m_foldersToUpdate.end());\r
+                                               m_foldersToUpdate.erase(std::unique(m_foldersToUpdate.begin(), m_foldersToUpdate.end(), &CTGitPath::PredLeftEquivalentToRight), m_foldersToUpdate.end());\r
                                                m_bItemsAddedSinceLastCrawl = false;\r
                                        }\r
-                                       // create a new CTSVNPath object to make sure the cached flags are requested again.\r
+                                       // create a new CTGitPath object to make sure the cached flags are requested again.\r
                                        // without this, a missing file/folder is still treated as missing even if it is available\r
                                        // now when crawling.\r
-                                       workingPath = CTSVNPath(m_foldersToUpdate.front().GetWinPath());\r
+                                       workingPath = CTGitPath(m_foldersToUpdate.front().GetWinPath());\r
                                        workingPath.SetCustomData(m_foldersToUpdate.front().GetCustomData());\r
                                        if ((DWORD(workingPath.GetCustomData()) < currentTicks)||(DWORD(workingPath.GetCustomData()) > (currentTicks + 200000)))\r
                                                m_foldersToUpdate.pop_front();\r
@@ -406,7 +406,7 @@ void CFolderCrawler::WorkerThread()
                                                // to crawl. That way, we still reduce the size of the list.\r
                                                if (m_foldersToUpdate.size() > 10)\r
                                                        ATLTRACE("attention: the list of folders to update is now %ld big!\n", m_foldersToUpdate.size());\r
-                                               for (std::deque<CTSVNPath>::iterator it = m_foldersToUpdate.begin(); it != m_foldersToUpdate.end(); ++it)\r
+                                               for (std::deque<CTGitPath>::iterator it = m_foldersToUpdate.begin(); it != m_foldersToUpdate.end(); ++it)\r
                                                {\r
                                                        workingPath = *it;\r
                                                        if ((DWORD(workingPath.GetCustomData()) < currentTicks)||(DWORD(workingPath.GetCustomData()) > (currentTicks + 200000)))\r
@@ -424,7 +424,7 @@ void CFolderCrawler::WorkerThread()
                                }\r
                                if ((!m_blockedPath.IsEmpty())&&(m_blockedPath.IsAncestorOf(workingPath)))\r
                                        continue;\r
-                               if (!CSVNStatusCache::Instance().IsPathAllowed(workingPath))\r
+                               if (!CGitStatusCache::Instance().IsPathAllowed(workingPath))\r
                                        continue;\r
 \r
                                ATLTRACE(_T("Crawling folder: %s\n"), workingPath.GetWinPath());\r
@@ -436,22 +436,22 @@ void CFolderCrawler::WorkerThread()
                                                nCurrentCrawledpathIndex = 0;\r
                                }\r
                                InvalidateRect(hWnd, NULL, FALSE);\r
-                               CSVNStatusCache::Instance().WaitToRead();\r
+                               CGitStatusCache::Instance().WaitToRead();\r
                                // Now, we need to visit this folder, to make sure that we know its 'most important' status\r
-                               CCachedDirectory * cachedDir = CSVNStatusCache::Instance().GetDirectoryCacheEntry(workingPath.GetDirectory());\r
+                               CCachedDirectory * cachedDir = CGitStatusCache::Instance().GetDirectoryCacheEntry(workingPath.GetDirectory());\r
                                // check if the path is monitored by the watcher. If it isn't, then we have to invalidate the cache\r
                                // for that path and add it to the watcher.\r
-                               if (!CSVNStatusCache::Instance().IsPathWatched(workingPath))\r
+                               if (!CGitStatusCache::Instance().IsPathWatched(workingPath))\r
                                {\r
                                        if (workingPath.HasAdminDir())\r
-                                               CSVNStatusCache::Instance().AddPathToWatch(workingPath);\r
+                                               CGitStatusCache::Instance().AddPathToWatch(workingPath);\r
                                        if (cachedDir)\r
                                                cachedDir->Invalidate();\r
                                        else\r
                                        {\r
-                                               CSVNStatusCache::Instance().Done();\r
-                                               CSVNStatusCache::Instance().WaitToWrite();\r
-                                               CSVNStatusCache::Instance().RemoveCacheForPath(workingPath);\r
+                                               CGitStatusCache::Instance().Done();\r
+                                               CGitStatusCache::Instance().WaitToWrite();\r
+                                               CGitStatusCache::Instance().RemoveCacheForPath(workingPath);\r
                                        }\r
                                }\r
                                if (cachedDir)\r
@@ -469,7 +469,7 @@ void CFolderCrawler::WorkerThread()
                                                m_bItemsAddedSinceLastCrawl = false;\r
                                        }\r
                                }\r
-                               CSVNStatusCache::Instance().Done();\r
+                               CGitStatusCache::Instance().Done();\r
                        }\r
                }\r
        }\r
@@ -484,7 +484,7 @@ bool CFolderCrawler::SetHoldoff(DWORD milliseconds /* = 100*/)
        return ret;\r
 }\r
 \r
-void CFolderCrawler::BlockPath(const CTSVNPath& path, DWORD ticks)\r
+void CFolderCrawler::BlockPath(const CTGitPath& path, DWORD ticks)\r
 {\r
        ATLTRACE(_T("block path %s from being crawled\n"), path.GetWinPath());\r
        m_blockedPath = path;\r
index 22f9d0b..9e89e51 100644 (file)
@@ -18,7 +18,7 @@
 //\r
 #pragma once\r
 \r
-#include "TSVNPath.h"\r
+#include "TGitPath.h"\r
 #include "CacheInterface.h"\r
 #include <set>\r
 //////////////////////////////////////////////////////////////////////////\r
@@ -40,11 +40,11 @@ public:
 \r
 public:\r
        void Initialise();\r
-       void AddDirectoryForUpdate(const CTSVNPath& path);\r
-       void AddPathForUpdate(const CTSVNPath& path);\r
+       void AddDirectoryForUpdate(const CTGitPath& path);\r
+       void AddPathForUpdate(const CTGitPath& path);\r
        void Stop();\r
        bool SetHoldoff(DWORD milliseconds = 100);\r
-       void BlockPath(const CTSVNPath& path, DWORD ticks = 0);\r
+       void BlockPath(const CTGitPath& path, DWORD ticks = 0);\r
 private:\r
        static unsigned int __stdcall ThreadEntry(void* pContext);\r
        void WorkerThread();\r
@@ -52,8 +52,8 @@ private:
 private:\r
        CComAutoCriticalSection m_critSec;\r
        HANDLE m_hThread;\r
-       std::deque<CTSVNPath> m_foldersToUpdate;\r
-       std::deque<CTSVNPath> m_pathsToUpdate;\r
+       std::deque<CTGitPath> m_foldersToUpdate;\r
+       std::deque<CTGitPath> m_pathsToUpdate;\r
        HANDLE m_hTerminationEvent;\r
        HANDLE m_hWakeEvent;\r
        \r
@@ -70,7 +70,7 @@ private:
        bool m_bItemsAddedSinceLastCrawl;\r
        bool m_bPathsAddedSinceLastCrawl;\r
        \r
-       CTSVNPath m_blockedPath;\r
+       CTGitPath m_blockedPath;\r
        DWORD m_blockReleasesAt;\r
        bool m_bRun;\r
 \r
index a8eeece..0e31e6f 100644 (file)
  * Provides access to a global object of itself which handles all\r
  * the requests for status.\r
  */\r
-class CSVNStatusCache\r
+class CGitStatusCache\r
 {\r
 private:\r
-       CSVNStatusCache(void);\r
-       ~CSVNStatusCache(void);\r
+       CGitStatusCache(void);\r
+       ~CGitStatusCache(void);\r
 \r
 public:\r
-       static CSVNStatusCache& Instance();\r
+       static CGitStatusCache& Instance();\r
        static void Create();\r
        static void Destroy();\r
        static bool SaveCache();\r
@@ -53,30 +53,30 @@ public:
        void Refresh();\r
 \r
        /// Get the status for a single path (main entry point, called from named-pipe code\r
-       CStatusCacheEntry GetStatusForPath(const CTSVNPath& path, DWORD flags,  bool bFetch = true);\r
+       CStatusCacheEntry GetStatusForPath(const CTGitPath& path, DWORD flags,  bool bFetch = true);\r
 \r
        /// Find a directory in the cache (a new entry will be created if there isn't an existing entry)\r
-       CCachedDirectory * GetDirectoryCacheEntry(const CTSVNPath& path);\r
-       CCachedDirectory * GetDirectoryCacheEntryNoCreate(const CTSVNPath& path);\r
+       CCachedDirectory * GetDirectoryCacheEntry(const CTGitPath& path);\r
+       CCachedDirectory * GetDirectoryCacheEntryNoCreate(const CTGitPath& path);\r
 \r
        /// Add a folder to the background crawler's work list\r
-       void AddFolderForCrawling(const CTSVNPath& path);\r
+       void AddFolderForCrawling(const CTGitPath& path);\r
 \r
        /// Removes the cache for a specific path, e.g. if a folder got deleted/renamed\r
-       void RemoveCacheForPath(const CTSVNPath& path);\r
+       void RemoveCacheForPath(const CTGitPath& path);\r
 \r
        /// Removes all items from the cache\r
        void ClearCache();\r
        \r
        /// Call this method before getting the status for a shell request\r
-       void StartRequest(const CTSVNPath& path);\r
+       void StartRequest(const CTGitPath& path);\r
        /// Call this method after the data for the shell request has been gathered\r
-       void EndRequest(const CTSVNPath& path);\r
+       void EndRequest(const CTGitPath& path);\r
        \r
        /// Notifies the shell about file/folder status changes.\r
        /// A notification is only sent for paths which aren't currently\r
        /// in the list of handled shell requests to avoid deadlocks.\r
-       void UpdateShell(const CTSVNPath& path);\r
+       void UpdateShell(const CTGitPath& path);\r
 \r
        size_t GetCacheSize() {return m_directoryCache.size();}\r
        int GetNumberOfWatchedPaths() {return watcher.GetNumberOfWatchedPaths();}\r
@@ -85,7 +85,7 @@ public:
        void Stop();\r
 \r
        void CloseWatcherHandles(HDEVNOTIFY hdev);\r
-       void CSVNStatusCache::CloseWatcherHandles(const CTSVNPath& path);\r
+       void CGitStatusCache::CloseWatcherHandles(const CTGitPath& path);\r
 \r
        bool WaitToRead(DWORD waitTime = INFINITE) {return m_rwSection.WaitToRead(waitTime);}\r
        bool WaitToWrite(DWORD waitTime = INFINITE) {return m_rwSection.WaitToWrite(waitTime);}\r
@@ -98,11 +98,11 @@ public:
        void AssertLock() {;}\r
        void AssertWriting() {;}\r
 #endif\r
-       bool IsPathAllowed(const CTSVNPath& path) {return !!m_shellCache.IsPathAllowed(path.GetWinPath());}\r
+       bool IsPathAllowed(const CTGitPath& path) {return !!m_shellCache.IsPathAllowed(path.GetWinPath());}\r
        bool IsUnversionedAsModified() {return !!m_shellCache.IsUnversionedAsModified();}\r
-       bool IsPathGood(const CTSVNPath& path);\r
-       bool IsPathWatched(const CTSVNPath& path) {return watcher.IsPathWatched(path);}\r
-       bool AddPathToWatch(const CTSVNPath& path) {return watcher.AddPath(path);}\r
+       bool IsPathGood(const CTGitPath& path);\r
+       bool IsPathWatched(const CTGitPath& path) {return watcher.IsPathWatched(path);}\r
+       bool AddPathToWatch(const CTGitPath& path) {return watcher.AddPath(path);}\r
 \r
        bool m_bClearMemory;\r
 private:\r
@@ -110,16 +110,16 @@ private:
        CRWSection m_rwSection;\r
        CAtlList<CString> m_askedList;\r
        CCachedDirectory::CachedDirMap m_directoryCache;\r
-       std::set<CTSVNPath> m_NoWatchPaths;\r
-       SVNHelper m_svnHelp;\r
+       std::set<CTGitPath> m_NoWatchPaths;\r
+//     SVNHelper m_svnHelp;\r
        ShellCache      m_shellCache;\r
 \r
-       static CSVNStatusCache* m_pInstance;\r
+       static CGitStatusCache* m_pInstance;\r
 \r
        CFolderCrawler m_folderCrawler;\r
        CShellUpdater m_shellUpdater;\r
 \r
-       CTSVNPath m_mostRecentPath;\r
+       CTGitPath m_mostRecentPath;\r
        CStatusCacheEntry m_mostRecentStatus;\r
        long m_mostRecentExpiresAt;\r
 \r
index ececade..5109a22 100644 (file)
 //\r
 \r
 #include "StdAfx.h"\r
-#include "SVNStatus.h"\r
-#include "Svnstatuscache.h"\r
+#include "GitStatus.h"\r
+#include "GitStatuscache.h"\r
 #include "CacheInterface.h"\r
 #include "shlobj.h"\r
 \r
 //////////////////////////////////////////////////////////////////////////\r
 \r
-CSVNStatusCache* CSVNStatusCache::m_pInstance;\r
+CGitStatusCache* CGitStatusCache::m_pInstance;\r
 \r
-CSVNStatusCache& CSVNStatusCache::Instance()\r
+CGitStatusCache& CGitStatusCache::Instance()\r
 {\r
        ATLASSERT(m_pInstance != NULL);\r
        return *m_pInstance;\r
 }\r
 \r
-void CSVNStatusCache::Create()\r
+void CGitStatusCache::Create()\r
 {\r
        ATLASSERT(m_pInstance == NULL);\r
-       m_pInstance = new CSVNStatusCache;\r
+       m_pInstance = new CGitStatusCache;\r
 \r
        m_pInstance->watcher.SetFolderCrawler(&m_pInstance->m_folderCrawler);\r
 #define LOADVALUEFROMFILE(x) if (fread(&x, sizeof(x), 1, pFile)!=1) goto exit;\r
@@ -97,12 +97,12 @@ void CSVNStatusCache::Create()
                                                        goto error;\r
                                                if (!cacheddir->LoadFromDisk(pFile))\r
                                                        goto error;\r
-                                               CTSVNPath KeyPath = CTSVNPath(sKey);\r
+                                               CTGitPath KeyPath = CTGitPath(sKey);\r
                                                if (m_pInstance->IsPathAllowed(KeyPath))\r
                                                {\r
                                                        m_pInstance->m_directoryCache[KeyPath] = cacheddir;\r
                                                        // only add the path to the watch list if it is versioned\r
-                                                       if ((cacheddir->GetCurrentFullStatus() != svn_wc_status_unversioned)&&(cacheddir->GetCurrentFullStatus() != svn_wc_status_none))\r
+                                                       if ((cacheddir->GetCurrentFullStatus() != git_wc_status_unversioned)&&(cacheddir->GetCurrentFullStatus() != git_wc_status_none))\r
                                                                m_pInstance->watcher.AddPath(KeyPath);\r
                                                        // do *not* add the paths for crawling!\r
                                                        // because crawled paths will trigger a shell\r
@@ -134,11 +134,11 @@ error:
                Sleep(100);\r
        }\r
        delete m_pInstance;\r
-       m_pInstance = new CSVNStatusCache;\r
+       m_pInstance = new CGitStatusCache;\r
        ATLTRACE("cache not loaded from disk\n");\r
 }\r
 \r
-bool CSVNStatusCache::SaveCache()\r
+bool CGitStatusCache::SaveCache()\r
 {\r
 #define WRITEVALUETOFILE(x) if (fwrite(&x, sizeof(x), 1, pFile)!=1) goto error;\r
        unsigned int value = 0;\r
@@ -196,7 +196,7 @@ error:
        return false;\r
 }\r
 \r
-void CSVNStatusCache::Destroy()\r
+void CGitStatusCache::Destroy()\r
 {\r
        if (m_pInstance)\r
        {\r
@@ -207,38 +207,38 @@ void CSVNStatusCache::Destroy()
        m_pInstance = NULL;\r
 }\r
 \r
-void CSVNStatusCache::Stop()\r
+void CGitStatusCache::Stop()\r
 {\r
-       m_svnHelp.Cancel(true);\r
+//     m_svnHelp.Cancel(true);\r
        watcher.Stop();\r
        m_folderCrawler.Stop();\r
        m_shellUpdater.Stop();\r
 }\r
 \r
-void CSVNStatusCache::Init()\r
+void CGitStatusCache::Init()\r
 {\r
        m_folderCrawler.Initialise();\r
        m_shellUpdater.Initialise();\r
 }\r
 \r
-CSVNStatusCache::CSVNStatusCache(void)\r
+CGitStatusCache::CGitStatusCache(void)\r
 {\r
        TCHAR path[MAX_PATH];\r
        SHGetFolderPath(NULL, CSIDL_COOKIES, NULL, 0, path);\r
-       m_NoWatchPaths.insert(CTSVNPath(CString(path)));\r
+       m_NoWatchPaths.insert(CTGitPath(CString(path)));\r
        SHGetFolderPath(NULL, CSIDL_HISTORY, NULL, 0, path);\r
-       m_NoWatchPaths.insert(CTSVNPath(CString(path)));\r
+       m_NoWatchPaths.insert(CTGitPath(CString(path)));\r
        SHGetFolderPath(NULL, CSIDL_INTERNET_CACHE, NULL, 0, path);\r
-       m_NoWatchPaths.insert(CTSVNPath(CString(path)));\r
+       m_NoWatchPaths.insert(CTGitPath(CString(path)));\r
        SHGetFolderPath(NULL, CSIDL_SYSTEM, NULL, 0, path);\r
-       m_NoWatchPaths.insert(CTSVNPath(CString(path)));\r
+       m_NoWatchPaths.insert(CTGitPath(CString(path)));\r
        SHGetFolderPath(NULL, CSIDL_WINDOWS, NULL, 0, path);\r
-       m_NoWatchPaths.insert(CTSVNPath(CString(path)));\r
+       m_NoWatchPaths.insert(CTGitPath(CString(path)));\r
        m_bClearMemory = false;\r
        m_mostRecentExpiresAt = 0;\r
 }\r
 \r
-CSVNStatusCache::~CSVNStatusCache(void)\r
+CGitStatusCache::~CGitStatusCache(void)\r
 {\r
        for (CCachedDirectory::CachedDirMap::iterator I = m_pInstance->m_directoryCache.begin(); I != m_pInstance->m_directoryCache.end(); ++I)\r
        {\r
@@ -247,10 +247,10 @@ CSVNStatusCache::~CSVNStatusCache(void)
        }\r
 }\r
 \r
-void CSVNStatusCache::Refresh()\r
+void CGitStatusCache::Refresh()\r
 {\r
        m_shellCache.ForceRefresh();\r
-       m_pInstance->m_svnHelp.ReloadConfig();\r
+//     m_pInstance->m_svnHelp.ReloadConfig();\r
        if (m_pInstance->m_directoryCache.size())\r
        {\r
                CCachedDirectory::CachedDirMap::iterator I = m_pInstance->m_directoryCache.begin();\r
@@ -260,7 +260,7 @@ void CSVNStatusCache::Refresh()
                                I->second->RefreshMostImportant();\r
                        else\r
                        {\r
-                               CSVNStatusCache::Instance().RemoveCacheForPath(I->first);\r
+                               CGitStatusCache::Instance().RemoveCacheForPath(I->first);\r
                                I = m_pInstance->m_directoryCache.begin();\r
                                if (I == m_pInstance->m_directoryCache.end())\r
                                        break;\r
@@ -269,9 +269,9 @@ void CSVNStatusCache::Refresh()
        }\r
 }\r
 \r
-bool CSVNStatusCache::IsPathGood(const CTSVNPath& path)\r
+bool CGitStatusCache::IsPathGood(const CTGitPath& path)\r
 {\r
-       for (std::set<CTSVNPath>::iterator it = m_NoWatchPaths.begin(); it != m_NoWatchPaths.end(); ++it)\r
+       for (std::set<CTGitPath>::iterator it = m_NoWatchPaths.begin(); it != m_NoWatchPaths.end(); ++it)\r
        {\r
                if (it->IsAncestorOf(path))\r
                        return false;\r
@@ -279,12 +279,12 @@ bool CSVNStatusCache::IsPathGood(const CTSVNPath& path)
        return true;\r
 }\r
 \r
-void CSVNStatusCache::UpdateShell(const CTSVNPath& path)\r
+void CGitStatusCache::UpdateShell(const CTGitPath& path)\r
 {\r
        m_shellUpdater.AddPathForUpdate(path);\r
 }\r
 \r
-void CSVNStatusCache::ClearCache()\r
+void CGitStatusCache::ClearCache()\r
 {\r
        for (CCachedDirectory::CachedDirMap::iterator I = m_directoryCache.begin(); I != m_directoryCache.end(); ++I)\r
        {\r
@@ -294,18 +294,18 @@ void CSVNStatusCache::ClearCache()
        m_directoryCache.clear();\r
 }\r
 \r
-bool CSVNStatusCache::RemoveCacheForDirectory(CCachedDirectory * cdir)\r
+bool CGitStatusCache::RemoveCacheForDirectory(CCachedDirectory * cdir)\r
 {\r
        if (cdir == NULL)\r
                return false;\r
        AssertWriting();\r
-       typedef std::map<CTSVNPath, svn_wc_status_kind>  ChildDirStatus;\r
+       typedef std::map<CTGitPath, git_wc_status_kind>  ChildDirStatus;\r
        if (cdir->m_childDirectories.size())\r
        {\r
                ChildDirStatus::iterator it = cdir->m_childDirectories.begin();\r
                for (; it != cdir->m_childDirectories.end(); )\r
                {\r
-                       CCachedDirectory * childdir = CSVNStatusCache::Instance().GetDirectoryCacheEntryNoCreate(it->first);\r
+                       CCachedDirectory * childdir = CGitStatusCache::Instance().GetDirectoryCacheEntryNoCreate(it->first);\r
                        if ((childdir)&&(!cdir->m_directoryPath.IsEquivalentTo(childdir->m_directoryPath)))\r
                                RemoveCacheForDirectory(childdir);\r
                        cdir->m_childDirectories.erase(it->first);\r
@@ -320,7 +320,7 @@ bool CSVNStatusCache::RemoveCacheForDirectory(CCachedDirectory * cdir)
        return true;\r
 }\r
 \r
-void CSVNStatusCache::RemoveCacheForPath(const CTSVNPath& path)\r
+void CGitStatusCache::RemoveCacheForPath(const CTGitPath& path)\r
 {\r
        // Stop the crawler starting on a new folder\r
        CCrawlInhibitor crawlInhibit(&m_folderCrawler);\r
@@ -337,7 +337,7 @@ void CSVNStatusCache::RemoveCacheForPath(const CTSVNPath& path)
        RemoveCacheForDirectory(dirtoremove);\r
 }\r
 \r
-CCachedDirectory * CSVNStatusCache::GetDirectoryCacheEntry(const CTSVNPath& path)\r
+CCachedDirectory * CGitStatusCache::GetDirectoryCacheEntry(const CTGitPath& path)\r
 {\r
        ATLASSERT(path.IsDirectory() || !PathFileExists(path.GetWinPath()));\r
 \r
@@ -373,10 +373,10 @@ CCachedDirectory * CSVNStatusCache::GetDirectoryCacheEntry(const CTSVNPath& path
                        m_directoryCache.erase(itMap);\r
                // We don't know anything about this directory yet - lets add it to our cache\r
                // but only if it exists!\r
-               if (path.Exists() && m_shellCache.IsPathAllowed(path.GetWinPath()) && !g_SVNAdminDir.IsAdminDirPath(path.GetWinPath()))\r
+               if (path.Exists() && m_shellCache.IsPathAllowed(path.GetWinPath()) && !g_GitAdminDir.IsAdminDirPath(path.GetWinPath()))\r
                {\r
                        // some notifications are for files which got removed/moved around.\r
-                       // In such cases, the CTSVNPath::IsDirectory() will return true (it assumes a directory if\r
+                       // In such cases, the CTGitPath::IsDirectory() will return true (it assumes a directory if\r
                        // the path doesn't exist). Which means we can get here with a path to a file\r
                        // instead of a directory.\r
                        // Since we're here most likely called from the crawler thread, the file could exist\r
@@ -399,7 +399,7 @@ CCachedDirectory * CSVNStatusCache::GetDirectoryCacheEntry(const CTSVNPath& path
        }\r
 }\r
 \r
-CCachedDirectory * CSVNStatusCache::GetDirectoryCacheEntryNoCreate(const CTSVNPath& path)\r
+CCachedDirectory * CGitStatusCache::GetDirectoryCacheEntryNoCreate(const CTGitPath& path)\r
 {\r
        ATLASSERT(path.IsDirectory() || !PathFileExists(path.GetWinPath()));\r
 \r
@@ -413,7 +413,7 @@ CCachedDirectory * CSVNStatusCache::GetDirectoryCacheEntryNoCreate(const CTSVNPa
        return NULL;\r
 }\r
 \r
-CStatusCacheEntry CSVNStatusCache::GetStatusForPath(const CTSVNPath& path, DWORD flags,  bool bFetch /* = true */)\r
+CStatusCacheEntry CGitStatusCache::GetStatusForPath(const CTGitPath& path, DWORD flags,  bool bFetch /* = true */)\r
 {\r
        bool bRecursive = !!(flags & TSVNCACHE_FLAGS_RECUSIVE_STATUS);\r
 \r
@@ -435,7 +435,7 @@ CStatusCacheEntry CSVNStatusCache::GetStatusForPath(const CTSVNPath& path, DWORD
                // Please note, that this may be a second "lock" used concurrently to the one in RemoveCacheForPath().\r
                CCrawlInhibitor crawlInhibit(&m_folderCrawler);\r
 \r
-               CTSVNPath dirpath = path.GetContainingDirectory();\r
+               CTGitPath dirpath = path.GetContainingDirectory();\r
                if ((dirpath.IsEmpty()) || (!m_shellCache.IsPathAllowed(dirpath.GetWinPath())))\r
                        dirpath = path.GetDirectory();\r
                CCachedDirectory * cachedDir = GetDirectoryCacheEntry(dirpath);\r
@@ -449,23 +449,23 @@ CStatusCacheEntry CSVNStatusCache::GetStatusForPath(const CTSVNPath& path, DWORD
        m_mostRecentStatus = CStatusCacheEntry();\r
        if (m_shellCache.ShowExcludedAsNormal() && path.IsDirectory() && m_shellCache.HasSVNAdminDir(path.GetWinPath(), true))\r
        {\r
-               m_mostRecentStatus.ForceStatus(svn_wc_status_normal);\r
+               m_mostRecentStatus.ForceStatus(git_wc_status_normal);\r
        }\r
        return m_mostRecentStatus;\r
 }\r
 \r
-void CSVNStatusCache::AddFolderForCrawling(const CTSVNPath& path)\r
+void CGitStatusCache::AddFolderForCrawling(const CTGitPath& path)\r
 {\r
        m_folderCrawler.AddDirectoryForUpdate(path);\r
 }\r
 \r
-void CSVNStatusCache::CloseWatcherHandles(HDEVNOTIFY hdev)\r
+void CGitStatusCache::CloseWatcherHandles(HDEVNOTIFY hdev)\r
 {\r
-       CTSVNPath path = watcher.CloseInfoMap(hdev);\r
+       CTGitPath path = watcher.CloseInfoMap(hdev);\r
        m_folderCrawler.BlockPath(path);\r
 }\r
 \r
-void CSVNStatusCache::CloseWatcherHandles(const CTSVNPath& path)\r
+void CGitStatusCache::CloseWatcherHandles(const CTGitPath& path)\r
 {\r
        watcher.CloseHandlesForPath(path);\r
        m_folderCrawler.BlockPath(path);\r
index 593f64e..7d409c8 100644 (file)
@@ -19,7 +19,7 @@
 \r
 #include "StdAfx.h"\r
 #include "shlobj.h"\r
-#include "SVNStatusCache.h"\r
+#include "GitStatusCache.h"\r
 \r
 CShellUpdater::CShellUpdater(void)\r
 {\r
@@ -70,7 +70,7 @@ void CShellUpdater::Initialise()
        SetThreadPriority(m_hThread, THREAD_PRIORITY_LOWEST);\r
 }\r
 \r
-void CShellUpdater::AddPathForUpdate(const CTSVNPath& path)\r
+void CShellUpdater::AddPathForUpdate(const CTGitPath& path)\r
 {\r
        {\r
                AutoLocker lock(m_critSec);\r
@@ -113,7 +113,7 @@ void CShellUpdater::WorkerThread()
                Sleep(50);\r
                for(;;)\r
                {\r
-                       CTSVNPath workingPath;\r
+                       CTGitPath workingPath;\r
                        if (!m_bRunning)\r
                                return;\r
                        Sleep(0);\r
@@ -127,7 +127,7 @@ void CShellUpdater::WorkerThread()
 \r
                                if(m_bItemsAddedSinceLastUpdate)\r
                                {\r
-                                       m_pathsToUpdate.erase(std::unique(m_pathsToUpdate.begin(), m_pathsToUpdate.end(), &CTSVNPath::PredLeftEquivalentToRight), m_pathsToUpdate.end());\r
+                                       m_pathsToUpdate.erase(std::unique(m_pathsToUpdate.begin(), m_pathsToUpdate.end(), &CTGitPath::PredLeftEquivalentToRight), m_pathsToUpdate.end());\r
                                        m_bItemsAddedSinceLastUpdate = false;\r
                                }\r
 \r
@@ -141,15 +141,15 @@ void CShellUpdater::WorkerThread()
                        {\r
                                // check if the path is monitored by the watcher. If it isn't, then we have to invalidate the cache\r
                                // for that path and add it to the watcher.\r
-                               if (!CSVNStatusCache::Instance().IsPathWatched(workingPath))\r
+                               if (!CGitStatusCache::Instance().IsPathWatched(workingPath))\r
                                {\r
                                        if (workingPath.HasAdminDir())\r
-                                               CSVNStatusCache::Instance().AddPathToWatch(workingPath);\r
+                                               CGitStatusCache::Instance().AddPathToWatch(workingPath);\r
                                }\r
                                // first send a notification about a sub folder change, so explorer doesn't discard\r
                                // the folder notification. Since we only know for sure that the subversion admin\r
                                // dir is present, we send a notification for that folder.\r
-                               CString admindir = workingPath.GetWinPathString() + _T("\\") + g_SVNAdminDir.GetAdminDirName();\r
+                               CString admindir = workingPath.GetWinPathString() + _T("\\") + g_GitAdminDir.GetAdminDirName();\r
                                SHChangeNotify(SHCNE_UPDATEITEM, SHCNF_PATH | SHCNF_FLUSHNOWAIT, (LPCTSTR)admindir, NULL);\r
                                SHChangeNotify(SHCNE_UPDATEITEM, SHCNF_PATH | SHCNF_FLUSHNOWAIT, workingPath.GetWinPath(), NULL);\r
                                // Sending an UPDATEDIR notification somehow overwrites/deletes the UPDATEITEM message. And without\r
index 8b8041c..ab8486f 100644 (file)
@@ -18,7 +18,7 @@
 //\r
 #pragma once\r
 \r
-#include "TSVNPath.h"\r
+#include "TGitPath.h"\r
 \r
 /**\r
  * \ingroup TSVNCache\r
@@ -33,7 +33,7 @@ public:
 \r
 public:\r
        void Initialise();\r
-       void AddPathForUpdate(const CTSVNPath& path);\r
+       void AddPathForUpdate(const CTGitPath& path);\r
        void Stop();\r
 \r
 private:\r
@@ -43,7 +43,7 @@ private:
 private:\r
        CComAutoCriticalSection m_critSec;\r
        HANDLE m_hThread;\r
-       std::deque<CTSVNPath> m_pathsToUpdate;\r
+       std::deque<CTGitPath> m_pathsToUpdate;\r
        HANDLE m_hTerminationEvent;\r
        HANDLE m_hWakeEvent;\r
        \r
index 5650bcf..0c90500 100644 (file)
@@ -18,7 +18,7 @@
 //\r
 #include "StdAfx.h"\r
 #include ".\statuscacheentry.h"\r
-#include "SVNStatus.h"\r
+#include "GitStatus.h"\r
 #include "CacheInterface.h"\r
 #include "registry.h"\r
 \r
@@ -27,21 +27,21 @@ DWORD cachetimeout = (DWORD)CRegStdWORD(_T("Software\\TortoiseSVN\\Cachetimeout"
 CStatusCacheEntry::CStatusCacheEntry()\r
        : m_bSet(false)\r
        , m_bSVNEntryFieldSet(false)\r
-       , m_kind(svn_node_unknown)\r
+//     , m_kind(svn_node_unknown)\r
        , m_bReadOnly(false)\r
-       , m_highestPriorityLocalStatus(svn_wc_status_none)\r
+       , m_highestPriorityLocalStatus(git_wc_status_none)\r
 {\r
        SetAsUnversioned();\r
 }\r
 \r
-CStatusCacheEntry::CStatusCacheEntry(const svn_wc_status2_t* pSVNStatus, __int64 lastWriteTime, bool bReadOnly, DWORD validuntil /* = 0*/)\r
+CStatusCacheEntry::CStatusCacheEntry(const git_wc_status2_t* pGitStatus, __int64 lastWriteTime, bool bReadOnly, DWORD validuntil /* = 0*/)\r
        : m_bSet(false)\r
        , m_bSVNEntryFieldSet(false)\r
-       , m_kind(svn_node_unknown)\r
+//     , m_kind(svn_node_unknown)\r
        , m_bReadOnly(false)\r
-       , m_highestPriorityLocalStatus(svn_wc_status_none)\r
+       , m_highestPriorityLocalStatus(git_wc_status_none)\r
 {\r
-       SetStatus(pSVNStatus);\r
+       SetStatus(pGitStatus);\r
        m_lastWriteTime = lastWriteTime;\r
        if (validuntil)\r
                m_discardAtTime = validuntil;\r
@@ -65,18 +65,17 @@ bool CStatusCacheEntry::SaveToDisk(FILE * pFile)
        WRITESTRINGTOFILE(m_sUrl);\r
        WRITESTRINGTOFILE(m_sOwner);\r
        WRITESTRINGTOFILE(m_sAuthor);\r
-       WRITEVALUETOFILE(m_kind);\r
+//     WRITEVALUETOFILE(m_kind);\r
        WRITEVALUETOFILE(m_bReadOnly);\r
        WRITESTRINGTOFILE(m_sPresentProps);\r
 \r
-       // now save the status struct (without the entry field, because we don't use that)\r
-       WRITEVALUETOFILE(m_svnStatus.copied);\r
-       WRITEVALUETOFILE(m_svnStatus.locked);\r
-       WRITEVALUETOFILE(m_svnStatus.prop_status);\r
-       WRITEVALUETOFILE(m_svnStatus.repos_prop_status);\r
-       WRITEVALUETOFILE(m_svnStatus.repos_text_status);\r
-       WRITEVALUETOFILE(m_svnStatus.switched);\r
-       WRITEVALUETOFILE(m_svnStatus.text_status);\r
+       // now save the status struct (without the entry field, because we don't use that)      WRITEVALUETOFILE(m_GitStatus.copied);\r
+//     WRITEVALUETOFILE(m_GitStatus.locked);\r
+//     WRITEVALUETOFILE(m_GitStatus.prop_status);\r
+//     WRITEVALUETOFILE(m_GitStatus.repos_prop_status);\r
+//     WRITEVALUETOFILE(m_GitStatus.repos_text_status);\r
+//     WRITEVALUETOFILE(m_GitStatus.switched);\r
+//     WRITEVALUETOFILE(m_GitStatus.text_status);\r
        return true;\r
 }\r
 \r
@@ -126,7 +125,7 @@ bool CStatusCacheEntry::LoadFromDisk(FILE * pFile)
                        }\r
                        m_sAuthor.ReleaseBuffer(value);\r
                }\r
-               LOADVALUEFROMFILE(m_kind);\r
+//             LOADVALUEFROMFILE(m_kind);\r
                LOADVALUEFROMFILE(m_bReadOnly);\r
                LOADVALUEFROMFILE(value);\r
                if (value != 0)\r
@@ -138,15 +137,15 @@ bool CStatusCacheEntry::LoadFromDisk(FILE * pFile)
                        }\r
                        m_sPresentProps.ReleaseBuffer(value);\r
                }\r
-               SecureZeroMemory(&m_svnStatus, sizeof(m_svnStatus));\r
-               LOADVALUEFROMFILE(m_svnStatus.copied);\r
-               LOADVALUEFROMFILE(m_svnStatus.locked);\r
-               LOADVALUEFROMFILE(m_svnStatus.prop_status);\r
-               LOADVALUEFROMFILE(m_svnStatus.repos_prop_status);\r
-               LOADVALUEFROMFILE(m_svnStatus.repos_text_status);\r
-               LOADVALUEFROMFILE(m_svnStatus.switched);\r
-               LOADVALUEFROMFILE(m_svnStatus.text_status);\r
-               m_svnStatus.entry = NULL;\r
+               SecureZeroMemory(&m_GitStatus, sizeof(m_GitStatus));\r
+//             LOADVALUEFROMFILE(m_GitStatus.copied);\r
+//             LOADVALUEFROMFILE(m_GitStatus.locked);\r
+//             LOADVALUEFROMFILE(m_GitStatus.prop_status);\r
+//             LOADVALUEFROMFILE(m_GitStatus.repos_prop_status);\r
+//             LOADVALUEFROMFILE(m_GitStatus.repos_text_status);\r
+//             LOADVALUEFROMFILE(m_GitStatus.switched);\r
+//             LOADVALUEFROMFILE(m_GitStatus.text_status);\r
+//             m_GitStatus.entry = NULL;\r
                m_discardAtTime = GetTickCount()+cachetimeout;\r
        }\r
        catch ( CAtlException )\r
@@ -156,28 +155,29 @@ bool CStatusCacheEntry::LoadFromDisk(FILE * pFile)
        return true;\r
 }\r
 \r
-void CStatusCacheEntry::SetStatus(const svn_wc_status2_t* pSVNStatus)\r
+void CStatusCacheEntry::SetStatus(const git_wc_status2_t* pGitStatus)\r
 {\r
-       if(pSVNStatus == NULL)\r
+       if(pGitStatus == NULL)\r
        {\r
                SetAsUnversioned();\r
        }\r
        else\r
        {\r
-               m_highestPriorityLocalStatus = SVNStatus::GetMoreImportant(pSVNStatus->prop_status, pSVNStatus->text_status);\r
-               m_svnStatus = *pSVNStatus;\r
+               m_highestPriorityLocalStatus = GitStatus::GetMoreImportant(pGitStatus->prop_status, pGitStatus->text_status);\r
+               m_GitStatus = *pGitStatus;\r
 \r
                // Currently we don't deep-copy the whole entry value, but we do take a few members\r
-        if(pSVNStatus->entry != NULL)\r
+#if 0\r
+        if(pGitStatus->entry != NULL)\r
                {\r
-                       m_sUrl = pSVNStatus->entry->url;\r
-                       m_commitRevision = pSVNStatus->entry->cmt_rev;\r
+                       m_sUrl = pGitStatus->entry->url;\r
+                       m_commitRevision = pGitStatus->entry->cmt_rev;\r
                        m_bSVNEntryFieldSet = true;\r
-                       m_sOwner = pSVNStatus->entry->lock_owner;\r
-                       m_kind = pSVNStatus->entry->kind;\r
-                       m_sAuthor = pSVNStatus->entry->cmt_author;\r
-                       if (pSVNStatus->entry->present_props)\r
-                               m_sPresentProps = pSVNStatus->entry->present_props;\r
+                       m_sOwner = pGitStatus->entry->lock_owner;\r
+                       m_kind = pGitStatus->entry->kind;\r
+                       m_sAuthor = pGitStatus->entry->cmt_author;\r
+                       if (pGitStatus->entry->present_props)\r
+                               m_sPresentProps = pGitStatus->entry->present_props;\r
                }\r
                else\r
                {\r
@@ -185,7 +185,8 @@ void CStatusCacheEntry::SetStatus(const svn_wc_status2_t* pSVNStatus)
                        m_commitRevision = 0;\r
                        m_bSVNEntryFieldSet = false;\r
                }\r
-               m_svnStatus.entry = NULL;\r
+               m_GitStatus.entry = NULL;\r
+#endif\r
        }\r
        m_discardAtTime = GetTickCount()+cachetimeout;\r
        m_bSet = true;\r
@@ -194,16 +195,16 @@ void CStatusCacheEntry::SetStatus(const svn_wc_status2_t* pSVNStatus)
 \r
 void CStatusCacheEntry::SetAsUnversioned()\r
 {\r
-       SecureZeroMemory(&m_svnStatus, sizeof(m_svnStatus));\r
+       SecureZeroMemory(&m_GitStatus, sizeof(m_GitStatus));\r
        m_discardAtTime = GetTickCount()+cachetimeout;\r
-       svn_wc_status_kind status = svn_wc_status_none;\r
-       if (m_highestPriorityLocalStatus == svn_wc_status_ignored)\r
-               status = svn_wc_status_ignored;\r
-       if (m_highestPriorityLocalStatus == svn_wc_status_unversioned)\r
-               status = svn_wc_status_unversioned;\r
+       git_wc_status_kind status = git_wc_status_none;\r
+       if (m_highestPriorityLocalStatus == git_wc_status_missing)\r
+               status = git_wc_status_missing;\r
+       if (m_highestPriorityLocalStatus == git_wc_status_unversioned)\r
+               status = git_wc_status_unversioned;\r
        m_highestPriorityLocalStatus = status;\r
-       m_svnStatus.prop_status = svn_wc_status_none;\r
-       m_svnStatus.text_status = status;\r
+       m_GitStatus.prop_status = git_wc_status_none;\r
+       m_GitStatus.text_status = status;\r
        m_lastWriteTime = 0;\r
 }\r
 \r
@@ -217,17 +218,17 @@ void CStatusCacheEntry::BuildCacheResponse(TSVNCacheResponse& response, DWORD& r
        SecureZeroMemory(&response, sizeof(response));\r
        if(m_bSVNEntryFieldSet)\r
        {\r
-               response.m_status = m_svnStatus;\r
-               response.m_entry.cmt_rev = m_commitRevision;\r
+               response.m_status = m_GitStatus;\r
+//             response.m_entry.cmt_rev = m_commitRevision;\r
 \r
                // There is no point trying to set these pointers here, because this is not \r
                // the process which will be using the data.\r
                // The process which receives this response (generally the TSVN Shell Extension)\r
                // must fix-up these pointers when it gets them\r
-               response.m_status.entry = NULL;\r
-               response.m_entry.url = NULL;\r
+//             response.m_status.entry = NULL;\r
+//             response.m_entry.url = NULL;\r
 \r
-               response.m_kind = m_kind;\r
+//             response.m_kind = m_kind;\r
                response.m_readonly = m_bReadOnly;\r
 \r
                if (m_sPresentProps.Find("svn:needs-lock")>=0)\r
@@ -244,14 +245,14 @@ void CStatusCacheEntry::BuildCacheResponse(TSVNCacheResponse& response, DWORD& r
        }\r
        else\r
        {\r
-               response.m_status = m_svnStatus;\r
+               response.m_status = m_GitStatus;\r
                responseLength = sizeof(response.m_status);\r
        }\r
 }\r
 \r
 bool CStatusCacheEntry::IsVersioned() const\r
 {\r
-       return m_highestPriorityLocalStatus > svn_wc_status_unversioned;\r
+       return m_highestPriorityLocalStatus > git_wc_status_unversioned;\r
 }\r
 \r
 bool CStatusCacheEntry::DoesFileTimeMatch(__int64 testTime) const\r
@@ -260,16 +261,16 @@ bool CStatusCacheEntry::DoesFileTimeMatch(__int64 testTime) const
 }\r
 \r
 \r
-bool CStatusCacheEntry::ForceStatus(svn_wc_status_kind forcedStatus)\r
+bool CStatusCacheEntry::ForceStatus(git_wc_status_kind forcedStatus)\r
 {\r
-       svn_wc_status_kind newStatus = forcedStatus; \r
+       git_wc_status_kind newStatus = forcedStatus; \r
 \r
        if(newStatus != m_highestPriorityLocalStatus)\r
        {\r
                // We've had a status change\r
                m_highestPriorityLocalStatus = newStatus;\r
-               m_svnStatus.text_status = newStatus;\r
-               m_svnStatus.prop_status = newStatus;\r
+               m_GitStatus.text_status = newStatus;\r
+               m_GitStatus.prop_status = newStatus;\r
                m_discardAtTime = GetTickCount()+cachetimeout;\r
                return true;\r
        }\r
index f99f38e..7610722 100644 (file)
@@ -32,31 +32,31 @@ class CStatusCacheEntry
 {\r
 public:\r
        CStatusCacheEntry();\r
-       CStatusCacheEntry(const git_wc_status2_t* pSVNStatus, __int64 lastWriteTime, bool bReadOnly, DWORD validuntil = 0);\r
+       CStatusCacheEntry(const git_wc_status2_t* pGitStatus, __int64 lastWriteTime, bool bReadOnly, DWORD validuntil = 0);\r
        bool HasExpired(long now) const;\r
        void BuildCacheResponse(TSVNCacheResponse& response, DWORD& responseLength) const;\r
        bool IsVersioned() const;\r
        bool DoesFileTimeMatch(__int64 testTime) const;\r
        bool ForceStatus(git_wc_status_kind forcedStatus);\r
        git_wc_status_kind GetEffectiveStatus() const { return m_highestPriorityLocalStatus; }\r
-       bool IsKindKnown() const { return ((m_kind != git_node_none)&&(m_kind != git_node_unknown)); }\r
-       void SetStatus(const git_wc_status2_t* pSVNStatus);\r
+       bool IsKindKnown() const { return true;/*((m_kind != git_node_none)&&(m_kind != git_node_unknown));*/ }\r
+       void SetStatus(const git_wc_status2_t* pGitStatus);\r
        bool HasBeenSet() const;\r
        void Invalidate();\r
-       bool IsDirectory() const {return ((m_kind == git_node_dir)&&(m_highestPriorityLocalStatus != git_wc_status_ignored));}\r
+       bool IsDirectory() const {return true; /*((m_kind == git_node_dir)&&(m_highestPriorityLocalStatus != git_wc_status_ignored));*/}\r
        bool SaveToDisk(FILE * pFile);\r
        bool LoadFromDisk(FILE * pFile);\r
-       void SetKind(git_node_kind_t kind) {m_kind = kind;}\r
+//     void SetKind(git_node_kind_t kind) {m_kind = kind;}\r
 private:\r
        void SetAsUnversioned();\r
 \r
 private:\r
        long                            m_discardAtTime;\r
        git_wc_status_kind      m_highestPriorityLocalStatus;\r
-       git_wc_status2_t        m_svnStatus;\r
+       git_wc_status2_t        m_GitStatus;\r
        __int64                         m_lastWriteTime;\r
        bool                            m_bSet;\r
-       git_node_kind_t         m_kind;\r
+//     git_node_kind_t         m_kind;\r
        bool                            m_bReadOnly;\r
 \r
        // Values copied from the 'entries' structure\r
@@ -67,5 +67,5 @@ private:
        CStringA                        m_sPresentProps;\r
        git_revnum_t            m_commitRevision;\r
 \r
-//     friend class CSVNStatusCache;\r
+//     friend class CGitStatusCache;\r
 };\r
index 5cb9a88..822acff 100644 (file)
 #include "stdafx.h"\r
 #include "shellapi.h"\r
 #include "TSVNCache.h"\r
-#include "SVNStatusCache.h"\r
+#include "GitStatusCache.h"\r
 #include "CacheInterface.h"\r
 #include "Resource.h"\r
 #include "registry.h"\r
-#include "..\crashrpt\CrashReport.h"\r
-#include "SVNAdminDir.h"\r
+//#include "..\crashrpt\CrashReport.h"\r
+#include "GitAdminDir.h"\r
 #include "Dbt.h"\r
 #include <initguid.h>\r
 #include "ioevent.h"\r
 #include "..\version.h"\r
-#include "svn_dso.h"\r
+//#include "svn_dso.h"\r
 \r
 #include <ShellAPI.h>\r
 \r
@@ -44,7 +44,7 @@
 \r
 #pragma comment(linker, "\"/manifestdependency:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")\r
 \r
-CCrashReport crasher("crashreports@tortoisesvn.tigris.org", "Crash Report for TSVNCache " APP_X64_STRING " : " STRPRODUCTVER, TRUE);// crash\r
+//CCrashReport crasher("crashreports@tortoisesvn.tigris.org", "Crash Report for TSVNCache " APP_X64_STRING " : " STRPRODUCTVER, TRUE);// crash\r
 \r
 DWORD WINAPI           InstanceThread(LPVOID); \r
 DWORD WINAPI           PipeThread(LPVOID);\r
@@ -141,11 +141,11 @@ int __stdcall WinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR /*
                return 0;\r
        }\r
 \r
-       apr_initialize();\r
-       svn_dso_initialize2();\r
-       g_SVNAdminDir.Init();\r
-       CSVNStatusCache::Create();\r
-       CSVNStatusCache::Instance().Init();\r
+//     apr_initialize();\r
+//     svn_dso_initialize2();\r
+       g_GitAdminDir.Init();\r
+       CGitStatusCache::Create();\r
+       CGitStatusCache::Instance().Init();\r
 \r
        SecureZeroMemory(szCurrentCrawledPath, sizeof(szCurrentCrawledPath));\r
        \r
@@ -261,9 +261,9 @@ int __stdcall WinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR /*
        bRun = false;\r
 \r
        Shell_NotifyIcon(NIM_DELETE,&niData);\r
-       CSVNStatusCache::Destroy();\r
-       g_SVNAdminDir.Close();\r
-       apr_terminate();\r
+       CGitStatusCache::Destroy();\r
+       g_GitAdminDir.Close();\r
+//     apr_terminate();\r
 \r
        return 0;\r
 }\r
@@ -287,8 +287,8 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
                                CString sInfoTip;\r
                                NOTIFYICONDATA SystemTray;\r
                                sInfoTip.Format(_T("Cached Directories : %ld\nWatched paths : %ld"), \r
-                                       CSVNStatusCache::Instance().GetCacheSize(),\r
-                                       CSVNStatusCache::Instance().GetNumberOfWatchedPaths());\r
+                                       CGitStatusCache::Instance().GetCacheSize(),\r
+                                       CGitStatusCache::Instance().GetNumberOfWatchedPaths());\r
 \r
                                SystemTray.cbSize = sizeof(NOTIFYICONDATA);\r
                                SystemTray.hWnd   = hTrayWnd;\r
@@ -366,10 +366,10 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
        case WM_QUERYENDSESSION:\r
                {\r
                        ATLTRACE("WM_QUERYENDSESSION\n");\r
-                       if (CSVNStatusCache::Instance().WaitToWrite(200))\r
+                       if (CGitStatusCache::Instance().WaitToWrite(200))\r
                        {\r
-                               CSVNStatusCache::Instance().Stop();\r
-                               CSVNStatusCache::Instance().Done();\r
+                               CGitStatusCache::Instance().Stop();\r
+                               CGitStatusCache::Instance().Done();\r
                        }\r
                        return TRUE;\r
                }\r
@@ -380,9 +380,9 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
        case WM_QUIT:\r
                {\r
                        ATLTRACE("WM_CLOSE/DESTROY/ENDSESSION/QUIT\n");\r
-                       CSVNStatusCache::Instance().WaitToWrite();\r
-                       CSVNStatusCache::Instance().Stop();\r
-                       CSVNStatusCache::Instance().SaveCache();\r
+                       CGitStatusCache::Instance().WaitToWrite();\r
+                       CGitStatusCache::Instance().Stop();\r
+                       CGitStatusCache::Instance().SaveCache();\r
                        if (message != WM_QUIT)\r
                                PostQuitMessage(0);\r
                        bRun = false;\r
@@ -403,16 +403,16 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
                                                if (IsEqualGUID(phandle->dbch_eventguid, GUID_IO_VOLUME_DISMOUNT))\r
                                                {\r
                                                        ATLTRACE("Device to be dismounted\n");\r
-                                                       CSVNStatusCache::Instance().WaitToWrite();\r
-                                                       CSVNStatusCache::Instance().CloseWatcherHandles(phandle->dbch_hdevnotify);\r
-                                                       CSVNStatusCache::Instance().Done();\r
+                                                       CGitStatusCache::Instance().WaitToWrite();\r
+                                                       CGitStatusCache::Instance().CloseWatcherHandles(phandle->dbch_hdevnotify);\r
+                                                       CGitStatusCache::Instance().Done();\r
                                                }\r
                                                if (IsEqualGUID(phandle->dbch_eventguid, GUID_IO_VOLUME_LOCK))\r
                                                {\r
                                                        ATLTRACE("Device lock event\n");\r
-                                                       CSVNStatusCache::Instance().WaitToWrite();\r
-                                                       CSVNStatusCache::Instance().CloseWatcherHandles(phandle->dbch_hdevnotify);\r
-                                                       CSVNStatusCache::Instance().Done();\r
+                                                       CGitStatusCache::Instance().WaitToWrite();\r
+                                                       CGitStatusCache::Instance().CloseWatcherHandles(phandle->dbch_hdevnotify);\r
+                                                       CGitStatusCache::Instance().Done();\r
                                                }\r
                                        }\r
                                }\r
@@ -422,15 +422,15 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
                                if (phdr->dbch_devicetype == DBT_DEVTYP_HANDLE)\r
                                {\r
                                        DEV_BROADCAST_HANDLE * phandle = (DEV_BROADCAST_HANDLE*)lParam;\r
-                                       CSVNStatusCache::Instance().WaitToWrite();\r
-                                       CSVNStatusCache::Instance().CloseWatcherHandles(phandle->dbch_hdevnotify);\r
-                                       CSVNStatusCache::Instance().Done();\r
+                                       CGitStatusCache::Instance().WaitToWrite();\r
+                                       CGitStatusCache::Instance().CloseWatcherHandles(phandle->dbch_hdevnotify);\r
+                                       CGitStatusCache::Instance().Done();\r
                                }\r
                                else\r
                                {\r
-                                       CSVNStatusCache::Instance().WaitToWrite();\r
-                                       CSVNStatusCache::Instance().CloseWatcherHandles(INVALID_HANDLE_VALUE);\r
-                                       CSVNStatusCache::Instance().Done();\r
+                                       CGitStatusCache::Instance().WaitToWrite();\r
+                                       CGitStatusCache::Instance().CloseWatcherHandles(INVALID_HANDLE_VALUE);\r
+                                       CGitStatusCache::Instance().Done();\r
                                }\r
                                break;\r
                        case DBT_DEVICEQUERYREMOVE:\r
@@ -438,15 +438,15 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
                                if (phdr->dbch_devicetype == DBT_DEVTYP_HANDLE)\r
                                {\r
                                        DEV_BROADCAST_HANDLE * phandle = (DEV_BROADCAST_HANDLE*)lParam;\r
-                                       CSVNStatusCache::Instance().WaitToWrite();\r
-                                       CSVNStatusCache::Instance().CloseWatcherHandles(phandle->dbch_hdevnotify);\r
-                                       CSVNStatusCache::Instance().Done();\r
+                                       CGitStatusCache::Instance().WaitToWrite();\r
+                                       CGitStatusCache::Instance().CloseWatcherHandles(phandle->dbch_hdevnotify);\r
+                                       CGitStatusCache::Instance().Done();\r
                                }\r
                                else\r
                                {\r
-                                       CSVNStatusCache::Instance().WaitToWrite();\r
-                                       CSVNStatusCache::Instance().CloseWatcherHandles(INVALID_HANDLE_VALUE);\r
-                                       CSVNStatusCache::Instance().Done();\r
+                                       CGitStatusCache::Instance().WaitToWrite();\r
+                                       CGitStatusCache::Instance().CloseWatcherHandles(INVALID_HANDLE_VALUE);\r
+                                       CGitStatusCache::Instance().Done();\r
                                }\r
                                break;\r
                        case DBT_DEVICEREMOVECOMPLETE:\r
@@ -454,15 +454,15 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
                                if (phdr->dbch_devicetype == DBT_DEVTYP_HANDLE)\r
                                {\r
                                        DEV_BROADCAST_HANDLE * phandle = (DEV_BROADCAST_HANDLE*)lParam;\r
-                                       CSVNStatusCache::Instance().WaitToWrite();\r
-                                       CSVNStatusCache::Instance().CloseWatcherHandles(phandle->dbch_hdevnotify);\r
-                                       CSVNStatusCache::Instance().Done();\r
+                                       CGitStatusCache::Instance().WaitToWrite();\r
+                                       CGitStatusCache::Instance().CloseWatcherHandles(phandle->dbch_hdevnotify);\r
+                                       CGitStatusCache::Instance().Done();\r
                                }\r
                                else\r
                                {\r
-                                       CSVNStatusCache::Instance().WaitToWrite();\r
-                                       CSVNStatusCache::Instance().CloseWatcherHandles(INVALID_HANDLE_VALUE);\r
-                                       CSVNStatusCache::Instance().Done();\r
+                                       CGitStatusCache::Instance().WaitToWrite();\r
+                                       CGitStatusCache::Instance().CloseWatcherHandles(INVALID_HANDLE_VALUE);\r
+                                       CGitStatusCache::Instance().Done();\r
                                }\r
                                break;\r
                        }\r
@@ -478,7 +478,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 \r
 VOID GetAnswerToRequest(const TSVNCacheRequest* pRequest, TSVNCacheResponse* pReply, DWORD* pResponseLength)\r
 {\r
-       CTSVNPath path;\r
+       CTGitPath path;\r
        *pResponseLength = 0;\r
        if(pRequest->flags & TSVNCACHE_FLAGS_FOLDERISKNOWN)\r
        {\r
@@ -489,10 +489,10 @@ VOID GetAnswerToRequest(const TSVNCacheRequest* pRequest, TSVNCacheResponse* pRe
                path.SetFromWin(pRequest->path);\r
        }\r
 \r
-       if (CSVNStatusCache::Instance().WaitToRead(2000))\r
+       if (CGitStatusCache::Instance().WaitToRead(2000))\r
        {\r
-               CSVNStatusCache::Instance().GetStatusForPath(path, pRequest->flags, false).BuildCacheResponse(*pReply, *pResponseLength);\r
-               CSVNStatusCache::Instance().Done();\r
+               CGitStatusCache::Instance().GetStatusForPath(path, pRequest->flags, false).BuildCacheResponse(*pReply, *pResponseLength);\r
+               CGitStatusCache::Instance().Done();\r
        }\r
        else\r
        {\r
@@ -772,29 +772,29 @@ DWORD WINAPI CommandThread(LPVOID lpvParam)
                                return 0;\r
                        case TSVNCACHECOMMAND_CRAWL:\r
                                {\r
-                                       CTSVNPath changedpath;\r
+                                       CTGitPath changedpath;\r
                                        changedpath.SetFromWin(CString(command.path), true);\r
                                        // remove the path from our cache - that will 'invalidate' it.\r
-                                       CSVNStatusCache::Instance().WaitToWrite();\r
-                                       CSVNStatusCache::Instance().RemoveCacheForPath(changedpath);\r
-                                       CSVNStatusCache::Instance().Done();\r
-                                       CSVNStatusCache::Instance().AddFolderForCrawling(changedpath.GetDirectory());\r
+                                       CGitStatusCache::Instance().WaitToWrite();\r
+                                       CGitStatusCache::Instance().RemoveCacheForPath(changedpath);\r
+                                       CGitStatusCache::Instance().Done();\r
+                                       CGitStatusCache::Instance().AddFolderForCrawling(changedpath.GetDirectory());\r
                                }\r
                                break;\r
                        case TSVNCACHECOMMAND_REFRESHALL:\r
-                               CSVNStatusCache::Instance().WaitToWrite();\r
-                               CSVNStatusCache::Instance().Refresh();\r
-                               CSVNStatusCache::Instance().Done();\r
+                               CGitStatusCache::Instance().WaitToWrite();\r
+                               CGitStatusCache::Instance().Refresh();\r
+                               CGitStatusCache::Instance().Done();\r
                                break;\r
                        case TSVNCACHECOMMAND_RELEASE:\r
                                {\r
-                                       CTSVNPath changedpath;\r
+                                       CTGitPath changedpath;\r
                                        changedpath.SetFromWin(CString(command.path), true);\r
                                        ATLTRACE(_T("release handle for path %s\n"), changedpath.GetWinPath());\r
-                                       CSVNStatusCache::Instance().WaitToWrite();\r
-                                       CSVNStatusCache::Instance().CloseWatcherHandles(changedpath);\r
-                                       CSVNStatusCache::Instance().RemoveCacheForPath(changedpath);\r
-                                       CSVNStatusCache::Instance().Done();\r
+                                       CGitStatusCache::Instance().WaitToWrite();\r
+                                       CGitStatusCache::Instance().CloseWatcherHandles(changedpath);\r
+                                       CGitStatusCache::Instance().RemoveCacheForPath(changedpath);\r
+                                       CGitStatusCache::Instance().Done();\r
                                }\r
                                break;\r
 \r
index bc4f210..7ecd10b 100644 (file)
@@ -24,6 +24,7 @@
                        OutputDirectory="..\..\bin\$(ConfigurationName)\bin"\r
                        IntermediateDirectory="..\..\obj\TSVNCache\$(ConfigurationName)\"\r
                        ConfigurationType="1"\r
+                       UseOfMFC="0"\r
                        UseOfATL="1"\r
                        CharacterSet="1"\r
                        >\r
                        <Tool\r
                                Name="VCLinkerTool"\r
                                IgnoreImportLibrary="true"\r
-                               AdditionalDependencies="Crypt32.lib ../../ext/Subversion\debug_win32\libsvn_diff-nonet.lib ../../ext/Subversion\debug_win32\libsvn_ra-nonet.lib ../../ext/Subversion\debug_win32\libsvn_wc-nonet.lib ../../ext/Subversion\debug_win32\libsvn_subr-nonet.lib ../../ext/Subversion\debug_win32\libsvn_client-nonet.lib ../../ext/Subversion\debug_win32\libsvn_delta-nonet.lib ../../ext/apr\debug_win32\libapr_tsvn.lib ../../ext/apr-util\debug_win32\libaprutil_tsvn.lib ../../ext/apr-util\xml\expat\lib\debug_win32\xml.lib ../../ext/libintl/libintl3-win32/lib/intl3_tsvn.lib"\r
+                               AdditionalDependencies="gdiplus.lib shfolder.lib shell32.lib comctl32.lib ws2_32.lib rpcrt4.lib shlwapi.lib wininet.lib version.lib Crypt32.lib"\r
                                OutputFile="$(OutDir)/TSVNCache.exe"\r
                                LinkIncremental="2"\r
-                               IgnoreDefaultLibraryNames="LIBC"\r
+                               IgnoreDefaultLibraryNames="libcd.lib;libc;shell32;LIBCMTD;"\r
                                GenerateDebugInformation="true"\r
                                ProgramDatabaseFile="$(OutDir)/TSVNCache.pdb"\r
                                SubSystem="2"\r
                                >\r
                        </File>\r
                        <File\r
+                               RelativePath="..\Git\Git.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\Git\GitAdminDir.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\Git\GitRev.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\Git\GitStatus.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
                                RelativePath="..\Utils\PathUtils.cpp"\r
                                >\r
                        </File>\r
                                </FileConfiguration>\r
                        </File>\r
                        <File\r
-                               RelativePath="..\Svn\SVNStatus.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
                                RelativePath=".\SVNStatusCache.cpp"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath=".\TSVNCache.cpp"\r
+                               RelativePath="..\Git\TGitPath.cpp"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\Svn\TSVNPath.cpp"\r
+                               RelativePath=".\TSVNCache.cpp"\r
                                >\r
                        </File>\r
                        <File\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath=".\SVNStatusCache.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
                                RelativePath=".\TSVNCache.h"\r
                                >\r
                        </File>\r
index e350f7b..de1acf5 100644 (file)
@@ -1,6 +1,6 @@
 \r
 Microsoft Visual Studio Solution File, Format Version 10.00\r
-# Visual Studio 2008\r
+# Visual C++ Express 2008\r
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Git", "Git\Git.vcproj", "{7CA5B1EB-8CC9-40A6-96D8-83649C1A870B}"\r
 EndProject\r
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TortoiseProc", "TortoiseProc\TortoiseProc.vcproj", "{50797F06-39C5-4802-8E2B-7B7A4EF03214}"\r