//\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
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
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
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
}\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
{\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
{\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
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
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
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
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
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
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
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