From 9a3bce6addad05691b7b59c385567df86c1ee461 Mon Sep 17 00:00:00 2001 From: Frank Li Date: Thu, 6 Nov 2008 11:22:52 +0800 Subject: [PATCH] build error link error --- TortoiseShell/ColumnProvider.cpp | 40 ++++--- TortoiseShell/ContextMenu.cpp | 212 +++++++++++++++++++------------------ TortoiseShell/Guids.h | 22 ++-- TortoiseShell/IconOverlay.cpp | 56 +++++----- TortoiseShell/RemoteCacheLink.cpp | 19 ++-- TortoiseShell/RemoteCacheLink.h | 2 +- TortoiseShell/ShellCache.h | 62 +++++------ TortoiseShell/ShellExt.cpp | 12 +-- TortoiseShell/ShellExt.h | 17 +-- TortoiseShell/TortoiseSVN.cpp | 36 +++---- TortoiseShell/TortoiseShell.vcproj | 90 +++------------- TortoiseShell/resource.h | 16 +-- TortoiseShell/resource.rc | 12 +-- TortoiseShell/stdafx.h | 16 +-- 14 files changed, 287 insertions(+), 325 deletions(-) diff --git a/TortoiseShell/ColumnProvider.cpp b/TortoiseShell/ColumnProvider.cpp index b48671a..56c549c 100644 --- a/TortoiseShell/ColumnProvider.cpp +++ b/TortoiseShell/ColumnProvider.cpp @@ -20,11 +20,11 @@ #include "ShellExt.h" #include "guids.h" #include "PreserveChdir.h" -#include "SVNProperties.h" +//#include "SVNProperties.h" #include "UnicodeUtils.h" -#include "SVNStatus.h" +#include "GitStatus.h" #include "PathUtils.h" -#include "..\TSVNCache\CacheInterface.h" +//#include "..\TSVNCache\CacheInterface.h" const static int ColumnFlags = SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT; @@ -57,7 +57,7 @@ STDMETHODIMP CShellExt::GetColumnInfo(DWORD dwIndex, SHCOLUMNINFO *psci) case 0: // SVN Status if (cachetype == ShellCache::none) return S_FALSE; - psci->scid.fmtid = CLSID_TortoiseSVN_UPTODATE; + psci->scid.fmtid = CLSID_Tortoisegit_UPTODATE; psci->scid.pid = dwIndex; psci->vt = VT_BSTR; psci->fmt = LVCFMT_LEFT; @@ -72,7 +72,7 @@ STDMETHODIMP CShellExt::GetColumnInfo(DWORD dwIndex, SHCOLUMNINFO *psci) case 1: // SVN Revision if (cachetype == ShellCache::none) return S_FALSE; - psci->scid.fmtid = CLSID_TortoiseSVN_UPTODATE; + psci->scid.fmtid = CLSID_Tortoisegit_UPTODATE; psci->scid.pid = dwIndex; psci->vt = VT_I4; psci->fmt = LVCFMT_RIGHT; @@ -87,7 +87,7 @@ STDMETHODIMP CShellExt::GetColumnInfo(DWORD dwIndex, SHCOLUMNINFO *psci) case 2: // SVN Url if (cachetype == ShellCache::none) return S_FALSE; - psci->scid.fmtid = CLSID_TortoiseSVN_UPTODATE; + psci->scid.fmtid = CLSID_Tortoisegit_UPTODATE; psci->scid.pid = dwIndex; psci->vt = VT_BSTR; psci->fmt = LVCFMT_LEFT; @@ -102,7 +102,7 @@ STDMETHODIMP CShellExt::GetColumnInfo(DWORD dwIndex, SHCOLUMNINFO *psci) case 3: // SVN Short Url if (cachetype == ShellCache::none) return S_FALSE; - psci->scid.fmtid = CLSID_TortoiseSVN_UPTODATE; + psci->scid.fmtid = CLSID_Tortoisegit_UPTODATE; psci->scid.pid = dwIndex; psci->vt = VT_BSTR; psci->fmt = LVCFMT_LEFT; @@ -127,7 +127,7 @@ STDMETHODIMP CShellExt::GetColumnInfo(DWORD dwIndex, SHCOLUMNINFO *psci) case 5: // SVN mime-type if (cachetype == ShellCache::none) return S_FALSE; - psci->scid.fmtid = CLSID_TortoiseSVN_UPTODATE; + psci->scid.fmtid = CLSID_Tortoisegit_UPTODATE; psci->scid.pid = dwIndex; psci->vt = VT_BSTR; psci->fmt = LVCFMT_LEFT; @@ -142,7 +142,7 @@ STDMETHODIMP CShellExt::GetColumnInfo(DWORD dwIndex, SHCOLUMNINFO *psci) case 6: // SVN Lock Owner if (cachetype == ShellCache::none) return S_FALSE; - psci->scid.fmtid = CLSID_TortoiseSVN_UPTODATE; + psci->scid.fmtid = CLSID_Tortoisegit_UPTODATE; psci->scid.pid = dwIndex; psci->vt = VT_BSTR; psci->fmt = LVCFMT_LEFT; @@ -157,7 +157,7 @@ STDMETHODIMP CShellExt::GetColumnInfo(DWORD dwIndex, SHCOLUMNINFO *psci) case 7: // SVN eol-style if (cachetype == ShellCache::none) return S_FALSE; - psci->scid.fmtid = CLSID_TortoiseSVN_UPTODATE; + psci->scid.fmtid = CLSID_Tortoisegit_UPTODATE; psci->scid.pid = dwIndex; psci->vt = VT_BSTR; psci->fmt = LVCFMT_LEFT; @@ -172,7 +172,7 @@ STDMETHODIMP CShellExt::GetColumnInfo(DWORD dwIndex, SHCOLUMNINFO *psci) case 8: // SVN Author if (cachetype == ShellCache::none) return S_FALSE; - psci->scid.fmtid = CLSID_TortoiseSVN_UPTODATE; + psci->scid.fmtid = CLSID_Tortoisegit_UPTODATE; psci->scid.pid = dwIndex; psci->vt = VT_BSTR; psci->fmt = LVCFMT_LEFT; @@ -198,7 +198,7 @@ STDMETHODIMP CShellExt::GetItemData(LPCSHCOLUMNID pscid, LPCSHCOLUMNDATA pscd, V } LoadLangDll(); ShellCache::CacheType cachetype = g_ShellCache.GetCacheType(); - if (pscid->fmtid == CLSID_TortoiseSVN_UPTODATE && pscid->pid < 8) + if (pscid->fmtid == CLSID_Tortoisegit_UPTODATE && pscid->pid < 8) { stdstring szInfo; const TCHAR * path = (TCHAR *)pscd->wszFile; @@ -211,16 +211,18 @@ STDMETHODIMP CShellExt::GetItemData(LPCSHCOLUMNID pscid, LPCSHCOLUMNDATA pscd, V { case 0: // SVN Status GetColumnStatus(path, pscd->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY); - SVNStatus::GetStatusString(g_hResInst, filestatus, buf, sizeof(buf)/sizeof(TCHAR), (WORD)CRegStdWORD(_T("Software\\TortoiseSVN\\LanguageID"), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT))); + GitStatus::GetStatusString(g_hResInst, filestatus, buf, sizeof(buf)/sizeof(TCHAR), (WORD)CRegStdWORD(_T("Software\\TortoiseSVN\\LanguageID"), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT))); szInfo = buf; break; case 1: // SVN Revision +#if 0 GetColumnStatus(path, pscd->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY); if (columnrev >= 0) { V_VT(pvarData) = VT_I4; V_I4(pvarData) = columnrev; } +#endif return S_OK; break; case 2: // SVN Url @@ -232,6 +234,7 @@ STDMETHODIMP CShellExt::GetItemData(LPCSHCOLUMNID pscid, LPCSHCOLUMNDATA pscd, V szInfo = itemshorturl; break; case 5: // SVN mime-type +#if 0 if (cachetype == ShellCache::none) return S_FALSE; if (g_ShellCache.IsPathAllowed(path)) @@ -245,12 +248,14 @@ STDMETHODIMP CShellExt::GetItemData(LPCSHCOLUMNID pscid, LPCSHCOLUMNDATA pscd, V } } } +#endif break; case 6: // SVN Lock Owner GetColumnStatus(path, pscd->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY); szInfo = owner; break; case 7: // SVN eol-style +#if 0 if (cachetype == ShellCache::none) return S_FALSE; if (g_ShellCache.IsPathAllowed(path)) @@ -264,6 +269,7 @@ STDMETHODIMP CShellExt::GetItemData(LPCSHCOLUMNID pscid, LPCSHCOLUMNDATA pscd, V } } } +#endif break; default: return S_FALSE; @@ -319,6 +325,7 @@ STDMETHODIMP CShellExt::Initialize(LPCSHCOLUMNINIT psci) void CShellExt::GetColumnStatus(const TCHAR * path, BOOL bIsDir) { +#if 0 PreserveChdir preserveChdir; if (_tcscmp(path, columnfilepath.c_str())==0) return; @@ -341,7 +348,7 @@ void CShellExt::GetColumnStatus(const TCHAR * path, BOOL bIsDir) } else { - filestatus = svn_wc_status_none; + filestatus = git_wc_status_none; columnauthor.clear(); columnrev = 0; itemurl.clear(); @@ -361,9 +368,9 @@ void CShellExt::GetColumnStatus(const TCHAR * path, BOOL bIsDir) case ShellCache::none: { if (g_ShellCache.HasSVNAdminDir(path, bIsDir)) - filestatus = svn_wc_status_normal; + filestatus = git_wc_status_normal; else - filestatus = svn_wc_status_none; + filestatus = git_wc_status_none; columnauthor.clear(); columnrev = 0; itemurl.clear(); @@ -457,5 +464,6 @@ void CShellExt::GetColumnStatus(const TCHAR * path, BOOL bIsDir) CPathUtils::Unescape(url); itemurl = UTF8ToWide(url); } +#endif } diff --git a/TortoiseShell/ContextMenu.cpp b/TortoiseShell/ContextMenu.cpp index bf98b69..e895dfa 100644 --- a/TortoiseShell/ContextMenu.cpp +++ b/TortoiseShell/ContextMenu.cpp @@ -1,6 +1,6 @@ -// TortoiseSVN - a Windows shell extension for easy version control +// TortoiseGit - a Windows shell extension for easy version control -// Copyright (C) 2003-2008 - TortoiseSVN +// Copyright (C) 2003-2008 - TortoiseGit // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -21,8 +21,9 @@ #include "ItemIDList.h" #include "PreserveChdir.h" #include "UnicodeUtils.h" -#include "SVNProperties.h" -#include "SVNStatus.h" +//#include "GitProperties.h" +#include "GitStatus.h" +#include "TGitPath.h" #define GetPIDLFolder(pida) (LPCITEMIDLIST)(((LPBYTE)pida)+(pida)->aoffset[0]) #define GetPIDLItem(pida, i) (LPCITEMIDLIST)(((LPBYTE)pida)+(pida)->aoffset[i+1]) @@ -192,6 +193,7 @@ STDMETHODIMP CShellExt::Initialize(LPCITEMIDLIST pIDFolder, LPDATAOBJECT pDataObj, HKEY /* hRegKey */) { +#if 0 ATLTRACE("Shell :: Initialize\n"); PreserveChdir preserveChdir; files_.clear(); @@ -201,7 +203,7 @@ STDMETHODIMP CShellExt::Initialize(LPCITEMIDLIST pIDFolder, itemStates = 0; itemStatesFolder = 0; stdstring statuspath; - svn_wc_status_kind fetchedstatus = svn_wc_status_none; + git_wc_status_kind fetchedstatus = git_wc_status_none; // get selected files/folders if (pDataObj) { @@ -255,7 +257,7 @@ STDMETHODIMP CShellExt::Initialize(LPCITEMIDLIST pIDFolder, { if (itemStates & ITEMIS_ONLYONE) { - CTSVNPath strpath; + CTGitPath strpath; strpath.SetFromWin(str.c_str()); itemStates |= (strpath.GetFileExtension().CompareNoCase(_T(".diff"))==0) ? ITEMIS_PATCHFILE : 0; itemStates |= (strpath.GetFileExtension().CompareNoCase(_T(".patch"))==0) ? ITEMIS_PATCHFILE : 0; @@ -264,25 +266,25 @@ STDMETHODIMP CShellExt::Initialize(LPCITEMIDLIST pIDFolder, if (i == 0) { //get the Subversion status of the item - svn_wc_status_kind status = svn_wc_status_none; - CTSVNPath askedpath; + git_wc_status_kind status = git_wc_status_none; + CTGitPath askedpath; askedpath.SetFromWin(str.c_str()); try { - SVNStatus stat; - stat.GetStatus(CTSVNPath(str.c_str()), false, true, true); + GitStatus stat; + //stat.GetStatus(CTGitPath(str.c_str()), false, true, true); if (stat.status) { statuspath = str; - status = SVNStatus::GetMoreImportant(stat.status->text_status, stat.status->prop_status); + status = GitStatus::GetMoreImportant(stat.status->text_status, stat.status->prop_status); fetchedstatus = status; if ((stat.status->entry)&&(stat.status->entry->lock_token)) itemStates |= (stat.status->entry->lock_token[0] != 0) ? ITEMIS_LOCKED : 0; - if ((stat.status->entry)&&(stat.status->entry->kind == svn_node_dir)) + if ((stat.status->entry)&&(stat.status->entry->kind == git_node_dir)) { itemStates |= ITEMIS_FOLDER; - if ((status != svn_wc_status_unversioned)&&(status != svn_wc_status_ignored)&&(status != svn_wc_status_none)) - itemStates |= ITEMIS_FOLDERINSVN; + if ((status != git_wc_status_unversioned)&&(status != git_wc_status_ignored)&&(status != git_wc_status_none)) + itemStates |= ITEMIS_FOLDERINGit; } if ((stat.status->entry)&&(stat.status->entry->present_props)) { @@ -294,28 +296,28 @@ STDMETHODIMP CShellExt::Initialize(LPCITEMIDLIST pIDFolder, } else { - // sometimes, svn_client_status() returns with an error. + // sometimes, git_client_status() returns with an error. // in that case, we have to check if the working copy is versioned // anyway to show the 'correct' context menu if (askedpath.HasAdminDir()) - status = svn_wc_status_normal; + status = git_wc_status_normal; } } catch ( ... ) { - ATLTRACE2(_T("Exception in SVNStatus::GetAllStatus()\n")); + ATLTRACE2(_T("Exception in GitStatus::GetAllStatus()\n")); } - if ((status != svn_wc_status_unversioned)&&(status != svn_wc_status_ignored)&&(status != svn_wc_status_none)) - itemStates |= ITEMIS_INSVN; - if (status == svn_wc_status_ignored) + if ((status != git_wc_status_unversioned)&&(status != git_wc_status_ignored)&&(status != git_wc_status_none)) + itemStates |= ITEMIS_INGit; + if (status == git_wc_status_ignored) itemStates |= ITEMIS_IGNORED; - if (status == svn_wc_status_normal) + if (status == git_wc_status_normal) itemStates |= ITEMIS_NORMAL; - if (status == svn_wc_status_conflicted) + if (status == git_wc_status_conflicted) itemStates |= ITEMIS_CONFLICTED; - if (status == svn_wc_status_added) + if (status == git_wc_status_added) itemStates |= ITEMIS_ADDED; - if (status == svn_wc_status_deleted) + if (status == git_wc_status_deleted) itemStates |= ITEMIS_DELETED; } } @@ -338,42 +340,42 @@ STDMETHODIMP CShellExt::Initialize(LPCITEMIDLIST pIDFolder, if ((str.empty() == false)&&(g_ShellCache.IsContextPathAllowed(str.c_str()))) { //check if our menu is requested for a subversion admin directory - if (g_SVNAdminDir.IsAdminDirPath(str.c_str())) + if (g_GitAdminDir.IsAdminDirPath(str.c_str())) continue; files_.push_back(str); - CTSVNPath strpath; + CTGitPath strpath; strpath.SetFromWin(str.c_str()); itemStates |= (strpath.GetFileExtension().CompareNoCase(_T(".diff"))==0) ? ITEMIS_PATCHFILE : 0; itemStates |= (strpath.GetFileExtension().CompareNoCase(_T(".patch"))==0) ? ITEMIS_PATCHFILE : 0; if (!statfetched) { //get the Subversion status of the item - svn_wc_status_kind status = svn_wc_status_none; + git_wc_status_kind status = git_wc_status_none; if ((g_ShellCache.IsSimpleContext())&&(strpath.IsDirectory())) { if (strpath.HasAdminDir()) - status = svn_wc_status_normal; + status = git_wc_status_normal; } else { try { - SVNStatus stat; + GitStatus stat; if (strpath.HasAdminDir()) stat.GetStatus(strpath, false, true, true); statuspath = str; if (stat.status) { - status = SVNStatus::GetMoreImportant(stat.status->text_status, stat.status->prop_status); + status = GitStatus::GetMoreImportant(stat.status->text_status, stat.status->prop_status); fetchedstatus = status; if ((stat.status->entry)&&(stat.status->entry->lock_token)) itemStates |= (stat.status->entry->lock_token[0] != 0) ? ITEMIS_LOCKED : 0; - if ((stat.status->entry)&&(stat.status->entry->kind == svn_node_dir)) + if ((stat.status->entry)&&(stat.status->entry->kind == git_node_dir)) { itemStates |= ITEMIS_FOLDER; - if ((status != svn_wc_status_unversioned)&&(status != svn_wc_status_ignored)&&(status != svn_wc_status_none)) - itemStates |= ITEMIS_FOLDERINSVN; + if ((status != git_wc_status_unversioned)&&(status != git_wc_status_ignored)&&(status != git_wc_status_none)) + itemStates |= ITEMIS_FOLDERINGit; } if ((stat.status->entry)&&(stat.status->entry->conflict_wrk)) itemStates |= ITEMIS_CONFLICTED; @@ -387,12 +389,12 @@ STDMETHODIMP CShellExt::Initialize(LPCITEMIDLIST pIDFolder, } else { - // sometimes, svn_client_status() returns with an error. + // sometimes, git_client_status() returns with an error. // in that case, we have to check if the working copy is versioned // anyway to show the 'correct' context menu if (strpath.HasAdminDir()) { - status = svn_wc_status_normal; + status = git_wc_status_normal; fetchedstatus = status; } } @@ -400,17 +402,17 @@ STDMETHODIMP CShellExt::Initialize(LPCITEMIDLIST pIDFolder, } catch ( ... ) { - ATLTRACE2(_T("Exception in SVNStatus::GetAllStatus()\n")); + ATLTRACE2(_T("Exception in GitStatus::GetAllStatus()\n")); } } - if ((status != svn_wc_status_unversioned)&&(status != svn_wc_status_ignored)&&(status != svn_wc_status_none)) - itemStates |= ITEMIS_INSVN; - if (status == svn_wc_status_ignored) + if ((status != git_wc_status_unversioned)&&(status != git_wc_status_ignored)&&(status != git_wc_status_none)) + itemStates |= ITEMIS_INGit; + if (status == git_wc_status_ignored) { itemStates |= ITEMIS_IGNORED; // the item is ignored. Get the svn:ignored properties so we can (maybe) later // offer a 'remove from ignored list' entry - SVNProperties props(strpath.GetContainingDirectory(), false); + GitProperties props(strpath.GetContainingDirectory(), false); ignoredprops.empty(); for (int p=0; ptext_status, stat.status->prop_status); + status = GitStatus::GetMoreImportant(stat.status->text_status, stat.status->prop_status); if ((stat.status->entry)&&(stat.status->entry->lock_token)) itemStatesFolder |= (stat.status->entry->lock_token[0] != 0) ? ITEMIS_LOCKED : 0; if ((stat.status->entry)&&(stat.status->entry->present_props)) @@ -489,40 +491,40 @@ STDMETHODIMP CShellExt::Initialize(LPCITEMIDLIST pIDFolder, } if ((stat.status->entry)&&(stat.status->entry->uuid)) uuidTarget = CUnicodeUtils::StdGetUnicode(stat.status->entry->uuid); - if ((status != svn_wc_status_unversioned)&&(status != svn_wc_status_ignored)&&(status != svn_wc_status_none)) - itemStatesFolder |= ITEMIS_INSVN; - if (status == svn_wc_status_normal) + if ((status != git_wc_status_unversioned)&&(status != git_wc_status_ignored)&&(status != git_wc_status_none)) + itemStatesFolder |= ITEMIS_INGit; + if (status == git_wc_status_normal) itemStatesFolder |= ITEMIS_NORMAL; - if (status == svn_wc_status_conflicted) + if (status == git_wc_status_conflicted) itemStatesFolder |= ITEMIS_CONFLICTED; - if (status == svn_wc_status_added) + if (status == git_wc_status_added) itemStatesFolder |= ITEMIS_ADDED; - if (status == svn_wc_status_deleted) + if (status == git_wc_status_deleted) itemStatesFolder |= ITEMIS_DELETED; } else { - // sometimes, svn_client_status() returns with an error. + // sometimes, git_client_status() returns with an error. // in that case, we have to check if the working copy is versioned // anyway to show the 'correct' context menu if (askedpath.HasAdminDir()) - status = svn_wc_status_normal; + status = git_wc_status_normal; } } catch ( ... ) { - ATLTRACE2(_T("Exception in SVNStatus::GetAllStatus()\n")); + ATLTRACE2(_T("Exception in GitStatus::GetAllStatus()\n")); } } else { status = fetchedstatus; } - if ((status != svn_wc_status_unversioned)&&(status != svn_wc_status_ignored)&&(status != svn_wc_status_none)) + if ((status != git_wc_status_unversioned)&&(status != git_wc_status_ignored)&&(status != git_wc_status_none)) { - itemStatesFolder |= ITEMIS_FOLDERINSVN; + itemStatesFolder |= ITEMIS_FOLDERINGit; } - if (status == svn_wc_status_ignored) + if (status == git_wc_status_ignored) itemStatesFolder |= ITEMIS_IGNORED; itemStatesFolder |= ITEMIS_FOLDER; if (files_.size() == 0) @@ -540,18 +542,18 @@ STDMETHODIMP CShellExt::Initialize(LPCITEMIDLIST pIDFolder, if (PathIsDirectory(files_.front().c_str())) { folder_ = files_.front(); - svn_wc_status_kind status = svn_wc_status_none; + git_wc_status_kind status = git_wc_status_none; if (folder_.compare(statuspath)!=0) { - CTSVNPath askedpath; + CTGitPath askedpath; askedpath.SetFromWin(folder_.c_str()); try { - SVNStatus stat; - stat.GetStatus(CTSVNPath(folder_.c_str()), false, true, true); + GitStatus stat; + stat.GetStatus(CTGitPath(folder_.c_str()), false, true, true); if (stat.status) { - status = SVNStatus::GetMoreImportant(stat.status->text_status, stat.status->prop_status); + status = GitStatus::GetMoreImportant(stat.status->text_status, stat.status->prop_status); if ((stat.status->entry)&&(stat.status->entry->lock_token)) itemStates |= (stat.status->entry->lock_token[0] != 0) ? ITEMIS_LOCKED : 0; if ((stat.status->entry)&&(stat.status->entry->present_props)) @@ -565,30 +567,30 @@ STDMETHODIMP CShellExt::Initialize(LPCITEMIDLIST pIDFolder, } catch ( ... ) { - ATLTRACE2(_T("Exception in SVNStatus::GetAllStatus()\n")); + ATLTRACE2(_T("Exception in GitStatus::GetAllStatus()\n")); } } else { status = fetchedstatus; } - if ((status != svn_wc_status_unversioned)&&(status != svn_wc_status_ignored)&&(status != svn_wc_status_none)) - itemStates |= ITEMIS_FOLDERINSVN; - if (status == svn_wc_status_ignored) + if ((status != git_wc_status_unversioned)&&(status != git_wc_status_ignored)&&(status != git_wc_status_none)) + itemStates |= ITEMIS_FOLDERINGit; + if (status == git_wc_status_ignored) itemStates |= ITEMIS_IGNORED; itemStates |= ITEMIS_FOLDER; - if (status == svn_wc_status_added) + if (status == git_wc_status_added) itemStates |= ITEMIS_ADDED; - if (status == svn_wc_status_deleted) + if (status == git_wc_status_deleted) itemStates |= ITEMIS_DELETED; } } } - +#endif return NOERROR; } -void CShellExt::InsertSVNMenu(BOOL istop, HMENU menu, UINT pos, UINT_PTR id, UINT stringid, UINT icon, UINT idCmdFirst, SVNCommands com, UINT uFlags) +void CShellExt::InsertGitMenu(BOOL istop, HMENU menu, UINT pos, UINT_PTR id, UINT stringid, UINT icon, UINT idCmdFirst, GitCommands com, UINT uFlags) { TCHAR menutextbuffer[255] = {0}; TCHAR verbsbuffer[255] = {0}; @@ -596,9 +598,9 @@ void CShellExt::InsertSVNMenu(BOOL istop, HMENU menu, UINT pos, UINT_PTR id, UIN if (istop) { - //menu entry for the top context menu, so append an "SVN " before + //menu entry for the top context menu, so append an "Git " before //the menu text to indicate where the entry comes from - _tcscpy_s(menutextbuffer, 255, _T("SVN ")); + _tcscpy_s(menutextbuffer, 255, _T("Git ")); } _tcscat_s(menutextbuffer, 255, stringtablebuffer); if ((fullver < 0x500)||(fullver == 0x500 && !uFlags)) @@ -628,9 +630,9 @@ void CShellExt::InsertSVNMenu(BOOL istop, HMENU menu, UINT pos, UINT_PTR id, UIN if (istop) { - //menu entry for the top context menu, so append an "SVN " before + //menu entry for the top context menu, so append an "Git " before //the menu text to indicate where the entry comes from - _tcscpy_s(menutextbuffer, 255, _T("SVN ")); + _tcscpy_s(menutextbuffer, 255, _T("Git ")); } LoadString(g_hResInst, stringid, verbsbuffer, sizeof(verbsbuffer)); _tcscat_s(menutextbuffer, 255, verbsbuffer); @@ -847,45 +849,45 @@ STDMETHODIMP CShellExt::QueryDropContext(UINT uFlags, UINT idCmdFirst, HMENU hMe //if they are versioned, they also can be exported to an unversioned location UINT idCmd = idCmdFirst; - // SVN move here + // Git move here // available if source is versioned but not added, target is versioned, source and target from same repository or target folder is added if ((bSourceAndTargetFromSameRepository||(itemStatesFolder & ITEMIS_ADDED))&&(itemStatesFolder & ITEMIS_FOLDERINSVN)&&((itemStates & ITEMIS_INSVN)&&((~itemStates) & ITEMIS_ADDED))) - InsertSVNMenu(FALSE, hMenu, indexMenu++, idCmd++, IDS_DROPMOVEMENU, 0, idCmdFirst, ShellMenuDropMove, uFlags); + InsertGitMenu(FALSE, hMenu, indexMenu++, idCmd++, IDS_DROPMOVEMENU, 0, idCmdFirst, ShellMenuDropMove, uFlags); - // SVN move and rename here + // Git move and rename here // available if source is a single, versioned but not added item, target is versioned, source and target from same repository or target folder is added if ((bSourceAndTargetFromSameRepository||(itemStatesFolder & ITEMIS_ADDED))&&(itemStatesFolder & ITEMIS_FOLDERINSVN)&&(itemStates & ITEMIS_INSVN)&&(itemStates & ITEMIS_ONLYONE)&&((~itemStates) & ITEMIS_ADDED)) - InsertSVNMenu(FALSE, hMenu, indexMenu++, idCmd++, IDS_DROPMOVERENAMEMENU, 0, idCmdFirst, ShellMenuDropMoveRename, uFlags); + InsertGitMenu(FALSE, hMenu, indexMenu++, idCmd++, IDS_DROPMOVERENAMEMENU, 0, idCmdFirst, ShellMenuDropMoveRename, uFlags); - // SVN copy here + // Git copy here // available if source is versioned but not added, target is versioned, source and target from same repository or target folder is added if ((bSourceAndTargetFromSameRepository||(itemStatesFolder & ITEMIS_ADDED))&&(itemStatesFolder & ITEMIS_FOLDERINSVN)&&(itemStates & ITEMIS_INSVN)&&((~itemStates) & ITEMIS_ADDED)) - InsertSVNMenu(FALSE, hMenu, indexMenu++, idCmd++, IDS_DROPCOPYMENU, 0, idCmdFirst, ShellMenuDropCopy, uFlags); + InsertGitMenu(FALSE, hMenu, indexMenu++, idCmd++, IDS_DROPCOPYMENU, 0, idCmdFirst, ShellMenuDropCopy, uFlags); - // SVN copy and rename here, source and target from same repository + // Git copy and rename here, source and target from same repository // available if source is a single, versioned but not added item, target is versioned or target folder is added if ((bSourceAndTargetFromSameRepository||(itemStatesFolder & ITEMIS_ADDED))&&(itemStatesFolder & ITEMIS_FOLDERINSVN)&&(itemStates & ITEMIS_INSVN)&&(itemStates & ITEMIS_ONLYONE)&&((~itemStates) & ITEMIS_ADDED)) - InsertSVNMenu(FALSE, hMenu, indexMenu++, idCmd++, IDS_DROPCOPYRENAMEMENU, 0, idCmdFirst, ShellMenuDropCopyRename, uFlags); + InsertGitMenu(FALSE, hMenu, indexMenu++, idCmd++, IDS_DROPCOPYRENAMEMENU, 0, idCmdFirst, ShellMenuDropCopyRename, uFlags); - // SVN add here + // Git add here // available if target is versioned and source is either unversioned or from another repository if ((itemStatesFolder & ITEMIS_FOLDERINSVN)&&(((~itemStates) & ITEMIS_INSVN)||!bSourceAndTargetFromSameRepository)) - InsertSVNMenu(FALSE, hMenu, indexMenu++, idCmd++, IDS_DROPCOPYADDMENU, 0, idCmdFirst, ShellMenuDropCopyAdd, uFlags); + InsertGitMenu(FALSE, hMenu, indexMenu++, idCmd++, IDS_DROPCOPYADDMENU, 0, idCmdFirst, ShellMenuDropCopyAdd, uFlags); - // SVN export here + // Git export here // available if source is versioned and a folder if ((itemStates & ITEMIS_INSVN)&&(itemStates & ITEMIS_FOLDER)) - InsertSVNMenu(FALSE, hMenu, indexMenu++, idCmd++, IDS_DROPEXPORTMENU, 0, idCmdFirst, ShellMenuDropExport, uFlags); + InsertGitMenu(FALSE, hMenu, indexMenu++, idCmd++, IDS_DROPEXPORTMENU, 0, idCmdFirst, ShellMenuDropExport, uFlags); - // SVN export all here + // Git export all here // available if source is versioned and a folder if ((itemStates & ITEMIS_INSVN)&&(itemStates & ITEMIS_FOLDER)) - InsertSVNMenu(FALSE, hMenu, indexMenu++, idCmd++, IDS_DROPEXPORTEXTENDEDMENU, 0, idCmdFirst, ShellMenuDropExportExtended, uFlags); + InsertGitMenu(FALSE, hMenu, indexMenu++, idCmd++, IDS_DROPEXPORTEXTENDEDMENU, 0, idCmdFirst, ShellMenuDropExportExtended, uFlags); // apply patch // available if source is a patchfile if (itemStates & ITEMIS_PATCHFILE) - InsertSVNMenu(FALSE, hMenu, indexMenu++, idCmd++, IDS_MENUAPPLYPATCH, 0, idCmdFirst, ShellMenuApplyPatch, uFlags); + InsertGitMenu(FALSE, hMenu, indexMenu++, idCmd++, IDS_MENUAPPLYPATCH, 0, idCmdFirst, ShellMenuApplyPatch, uFlags); // separator if (idCmd != idCmdFirst) @@ -962,7 +964,7 @@ STDMETHODIMP CShellExt::QueryContextMenu(HMENU hMenu, } //check if our menu is requested for a subversion admin directory - if (g_SVNAdminDir.IsAdminDirPath(folder_.c_str())) + if (g_GitAdminDir.IsAdminDirPath(folder_.c_str())) return NOERROR; if (uFlags & CMF_EXTENDEDVERBS) @@ -976,7 +978,7 @@ STDMETHODIMP CShellExt::QueryContextMenu(HMENU hMenu, // It would only show the standard menu items // which are already shown for the lnk-file. CString path = files_.front().c_str(); - if ( !g_SVNAdminDir.HasAdminDir(path) ) + if ( !g_GitAdminDir.HasAdminDir(path) ) { return NOERROR; } @@ -1016,7 +1018,7 @@ STDMETHODIMP CShellExt::QueryContextMenu(HMENU hMenu, bool bMenuEntryAdded = false; // insert separator at start InsertMenu(hMenu, indexMenu++, MF_SEPARATOR|MF_BYPOSITION, 0, NULL); idCmd++; - bool bShowIcons = !!DWORD(CRegStdWORD(_T("Software\\TortoiseSVN\\ShowContextMenuIcons"), TRUE)); + bool bShowIcons = !!DWORD(CRegStdWORD(_T("Software\\TortoiseGit\\ShowContextMenuIcons"), TRUE)); if (fullver <= 0x0500) bShowIcons = false; while (menuInfo[menuIndex].command != ShellMenuLastEntry) @@ -1111,7 +1113,7 @@ STDMETHODIMP CShellExt::QueryContextMenu(HMENU hMenu, bIsTop = true; } // insert the menu entry - InsertSVNMenu( bIsTop, + InsertGitMenu( bIsTop, bIsTop ? hMenu : subMenu, bIsTop ? indexMenu++ : indexSubMenu++, idCmd++, @@ -1231,8 +1233,8 @@ STDMETHODIMP CShellExt::InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi) memset(&startup, 0, sizeof(startup)); startup.cb = sizeof(startup); memset(&process, 0, sizeof(process)); - CRegStdString tortoiseProcPath(_T("Software\\TortoiseSVN\\ProcPath"), _T("TortoiseProc.exe"), false, HKEY_LOCAL_MACHINE); - CRegStdString tortoiseMergePath(_T("Software\\TortoiseSVN\\TMergePath"), _T("TortoiseMerge.exe"), false, HKEY_LOCAL_MACHINE); + CRegStdString tortoiseProcPath(_T("Software\\TortoiseGit\\ProcPath"), _T("TortoiseProc.exe"), false, HKEY_LOCAL_MACHINE); + CRegStdString tortoiseMergePath(_T("Software\\TortoiseGit\\TMergePath"), _T("TortoiseMerge.exe"), false, HKEY_LOCAL_MACHINE); //TortoiseProc expects a command line of the form: //"/command: /pathfile: /startrev: /endrev: /deletepathfile @@ -1594,7 +1596,7 @@ STDMETHODIMP CShellExt::InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi) { // if there's a patch file in the clipboard, we save it // to a temporary file and tell TortoiseMerge to use that one - UINT cFormat = RegisterClipboardFormat(_T("TSVN_UNIFIEDDIFF")); + UINT cFormat = RegisterClipboardFormat(_T("Tgit_UNIFIEDDIFF")); if ((cFormat)&&(OpenClipboard(NULL))) { HGLOBAL hglb = GetClipboardData(cFormat); @@ -1807,7 +1809,7 @@ STDMETHODIMP CShellExt::GetCommandString(UINT_PTR idCmd, int menuIndex = 0; while (menuInfo[menuIndex].command != ShellMenuLastEntry) { - if (menuInfo[menuIndex].command == (SVNCommands)id_it->second) + if (menuInfo[menuIndex].command == (GitCommands)id_it->second) { MAKESTRING(menuInfo[menuIndex].menuDescID); break; @@ -2008,7 +2010,7 @@ LPCTSTR CShellExt::GetMenuTextFromResource(int id) space = ((layout & MENULOCK) || ((itemStates & ITEMIS_NEEDSLOCK) && g_ShellCache.IsGetLockTop())) ? 0 : 6; if ((layout & MENULOCK) || ((itemStates & ITEMIS_NEEDSLOCK) && g_ShellCache.IsGetLockTop())) { - _tcscpy_s(textbuf, 255, _T("SVN ")); + _tcscpy_s(textbuf, 255, _T("Git ")); _tcscat_s(textbuf, 255, stringtablebuffer); _tcscpy_s(stringtablebuffer, 255, textbuf); } @@ -2025,7 +2027,7 @@ LPCTSTR CShellExt::GetMenuTextFromResource(int id) space = layout & menuInfo[menuIndex].menuID ? 0 : 6; if (layout & (menuInfo[menuIndex].menuID)) { - _tcscpy_s(textbuf, 255, _T("SVN ")); + _tcscpy_s(textbuf, 255, _T("Git ")); _tcscat_s(textbuf, 255, stringtablebuffer); _tcscpy_s(stringtablebuffer, 255, textbuf); } diff --git a/TortoiseShell/Guids.h b/TortoiseShell/Guids.h index 50d1356..0143e94 100644 --- a/TortoiseShell/Guids.h +++ b/TortoiseShell/Guids.h @@ -39,16 +39,16 @@ // to generate a new GUID. // -DEFINE_GUID(CLSID_TortoiseSVN_UPTODATE,0x30351346, 0x7b7d, 0x4fcc, 0x81, 0xb4, 0x1e, 0x39, 0x4c, 0xa2, 0x67, 0xeb); -DEFINE_GUID(CLSID_TortoiseSVN_MODIFIED,0x30351347, 0x7b7d, 0x4fcc, 0x81, 0xb4, 0x1e, 0x39, 0x4c, 0xa2, 0x67, 0xeb); -DEFINE_GUID(CLSID_TortoiseSVN_CONFLICTING,0x30351348, 0x7b7d, 0x4fcc, 0x81, 0xb4, 0x1e, 0x39, 0x4c, 0xa2, 0x67, 0xeb); -DEFINE_GUID(CLSID_TortoiseSVN_UNCONTROLLED,0x30351349, 0x7b7d, 0x4fcc, 0x81, 0xb4, 0x1e, 0x39, 0x4c, 0xa2, 0x67, 0xeb); -DEFINE_GUID(CLSID_TortoiseSVN_DROPHANDLER,0x3035134a, 0x7b7d, 0x4fcc, 0x81, 0xb4, 0x1e, 0x39, 0x4c, 0xa2, 0x67, 0xeb); -DEFINE_GUID(CLSID_TortoiseSVN_READONLY,0x3035134b, 0x7b7d, 0x4fcc, 0x81, 0xb4, 0x1e, 0x39, 0x4c, 0xa2, 0x67, 0xeb); -DEFINE_GUID(CLSID_TortoiseSVN_DELETED,0x3035134c, 0x7b7d, 0x4fcc, 0x81, 0xb4, 0x1e, 0x39, 0x4c, 0xa2, 0x67, 0xeb); -DEFINE_GUID(CLSID_TortoiseSVN_LOCKED,0x3035134d, 0x7b7d, 0x4fcc, 0x81, 0xb4, 0x1e, 0x39, 0x4c, 0xa2, 0x67, 0xeb); -DEFINE_GUID(CLSID_TortoiseSVN_ADDED,0x3035134e, 0x7b7d, 0x4fcc, 0x81, 0xb4, 0x1e, 0x39, 0x4c, 0xa2, 0x67, 0xeb); -DEFINE_GUID(CLSID_TortoiseSVN_IGNORED,0x3035134f, 0x7b7d, 0x4fcc, 0x81, 0xb4, 0x1e, 0x39, 0x4c, 0xa2, 0x67, 0xeb); -DEFINE_GUID(CLSID_TortoiseSVN_UNVERSIONED,0x30351350, 0x7b7d, 0x4fcc, 0x81, 0xb4, 0x1e, 0x39, 0x4c, 0xa2, 0x67, 0xeb); +DEFINE_GUID(CLSID_Tortoisegit_UPTODATE,0x30351346, 0x7b7d, 0x4fcc, 0x81, 0xb4, 0x1e, 0x39, 0x4c, 0xa2, 0x67, 0xeb); +DEFINE_GUID(CLSID_Tortoisegit_MODIFIED,0x30351347, 0x7b7d, 0x4fcc, 0x81, 0xb4, 0x1e, 0x39, 0x4c, 0xa2, 0x67, 0xeb); +DEFINE_GUID(CLSID_Tortoisegit_CONFLICTING,0x30351348, 0x7b7d, 0x4fcc, 0x81, 0xb4, 0x1e, 0x39, 0x4c, 0xa2, 0x67, 0xeb); +DEFINE_GUID(CLSID_Tortoisegit_UNCONTROLLED,0x30351349, 0x7b7d, 0x4fcc, 0x81, 0xb4, 0x1e, 0x39, 0x4c, 0xa2, 0x67, 0xeb); +DEFINE_GUID(CLSID_Tortoisegit_DROPHANDLER,0x3035134a, 0x7b7d, 0x4fcc, 0x81, 0xb4, 0x1e, 0x39, 0x4c, 0xa2, 0x67, 0xeb); +DEFINE_GUID(CLSID_Tortoisegit_READONLY,0x3035134b, 0x7b7d, 0x4fcc, 0x81, 0xb4, 0x1e, 0x39, 0x4c, 0xa2, 0x67, 0xeb); +DEFINE_GUID(CLSID_Tortoisegit_DELETED,0x3035134c, 0x7b7d, 0x4fcc, 0x81, 0xb4, 0x1e, 0x39, 0x4c, 0xa2, 0x67, 0xeb); +DEFINE_GUID(CLSID_Tortoisegit_LOCKED,0x3035134d, 0x7b7d, 0x4fcc, 0x81, 0xb4, 0x1e, 0x39, 0x4c, 0xa2, 0x67, 0xeb); +DEFINE_GUID(CLSID_Tortoisegit_ADDED,0x3035134e, 0x7b7d, 0x4fcc, 0x81, 0xb4, 0x1e, 0x39, 0x4c, 0xa2, 0x67, 0xeb); +DEFINE_GUID(CLSID_Tortoisegit_IGNORED,0x3035134f, 0x7b7d, 0x4fcc, 0x81, 0xb4, 0x1e, 0x39, 0x4c, 0xa2, 0x67, 0xeb); +DEFINE_GUID(CLSID_Tortoisegit_UNVERSIONED,0x30351350, 0x7b7d, 0x4fcc, 0x81, 0xb4, 0x1e, 0x39, 0x4c, 0xa2, 0x67, 0xeb); diff --git a/TortoiseShell/IconOverlay.cpp b/TortoiseShell/IconOverlay.cpp index 5a2535f..efe9d85 100644 --- a/TortoiseShell/IconOverlay.cpp +++ b/TortoiseShell/IconOverlay.cpp @@ -21,8 +21,8 @@ #include "Guids.h" #include "PreserveChdir.h" #include "UnicodeUtils.h" -#include "SVNStatus.h" -#include "..\TSVNCache\CacheInterface.h" +#include "GitStatus.h" +//#include "..\TSVNCache\CacheInterface.h" // "The Shell calls IShellIconOverlayIdentifier::GetOverlayInfo to request the // location of the handler's icon overlay. The icon overlay handler returns @@ -97,7 +97,7 @@ STDMETHODIMP CShellExt::GetPriority(int *pPriority) STDMETHODIMP CShellExt::IsMemberOf(LPCWSTR pwszPath, DWORD /*dwAttrib*/) { PreserveChdir preserveChdir; - svn_wc_status_kind status = svn_wc_status_none; + git_wc_status_kind status = git_wc_status_none; bool readonlyoverlay = false; bool lockedoverlay = false; if (pwszPath == NULL) @@ -137,21 +137,24 @@ STDMETHODIMP CShellExt::IsMemberOf(LPCWSTR pwszPath, DWORD /*dwAttrib*/) { case ShellCache::exe: { +#if 0 TSVNCacheResponse itemStatus; SecureZeroMemory(&itemStatus, sizeof(itemStatus)); if (m_remoteCacheLink.GetStatusFromRemoteCache(CTSVNPath(pPath), &itemStatus, true)) { status = SVNStatus::GetMoreImportant(itemStatus.m_status.text_status, itemStatus.m_status.prop_status); - if ((itemStatus.m_kind == svn_node_file)&&(status == svn_wc_status_normal)&&((itemStatus.m_needslock && itemStatus.m_owner[0]==0)||(itemStatus.m_readonly))) + if ((itemStatus.m_kind == git_node_file)&&(status == git_wc_status_normal)&&((itemStatus.m_needslock && itemStatus.m_owner[0]==0)||(itemStatus.m_readonly))) readonlyoverlay = true; if (itemStatus.m_owner[0]!=0) lockedoverlay = true; } +#endif } break; case ShellCache::dll: { // Look in our caches for this item +#if 0 const FileStatusCacheEntry * s = m_CachedStatus.GetCachedItem(CTSVNPath(pPath)); if (s) { @@ -170,18 +173,18 @@ STDMETHODIMP CShellExt::IsMemberOf(LPCWSTR pwszPath, DWORD /*dwAttrib*/) { if ((!g_ShellCache.IsRecursive()) && (!g_ShellCache.IsFolderOverlay())) { - status = svn_wc_status_normal; + status = git_wc_status_normal; } else { const FileStatusCacheEntry * s = m_CachedStatus.GetFullStatus(CTSVNPath(pPath), TRUE); status = s->status; - status = SVNStatus::GetMoreImportant(svn_wc_status_normal, status); + status = SVNStatus::GetMoreImportant(git_wc_status_normal, status); } } else { - status = svn_wc_status_none; + status = git_wc_status_none; } } else @@ -190,12 +193,13 @@ STDMETHODIMP CShellExt::IsMemberOf(LPCWSTR pwszPath, DWORD /*dwAttrib*/) status = s->status; } } - if ((s)&&(status == svn_wc_status_normal)&&(s->needslock)&&(s->owner[0]==0)) + if ((s)&&(status == git_wc_status_normal)&&(s->needslock)&&(s->owner[0]==0)) readonlyoverlay = true; if ((s)&&(s->owner[0]!=0)) lockedoverlay = true; - +#endif } + break; default: case ShellCache::none: @@ -206,16 +210,16 @@ STDMETHODIMP CShellExt::IsMemberOf(LPCWSTR pwszPath, DWORD /*dwAttrib*/) { if (g_ShellCache.HasSVNAdminDir(pPath, TRUE)) { - status = svn_wc_status_normal; + status = git_wc_status_normal; } else { - status = svn_wc_status_none; + status = git_wc_status_none; } } else { - status = svn_wc_status_none; + status = git_wc_status_none; } } break; @@ -237,25 +241,25 @@ STDMETHODIMP CShellExt::IsMemberOf(LPCWSTR pwszPath, DWORD /*dwAttrib*/) // note: we can show other overlays if due to lack of enough free overlay // slots some of our overlays aren't loaded. But we assume that // at least the 'normal' and 'modified' overlay are available. - case svn_wc_status_none: + case git_wc_status_none: return S_FALSE; - case svn_wc_status_unversioned: + case git_wc_status_unversioned: if (g_ShellCache.ShowUnversionedOverlay() && g_unversionedovlloaded && (m_State == FileStateUnversionedOverlay)) { g_filepath.clear(); return S_OK; } return S_FALSE; - case svn_wc_status_ignored: + case git_wc_status_ignored: if (g_ShellCache.ShowIgnoredOverlay() && g_ignoredovlloaded && (m_State == FileStateIgnoredOverlay)) { g_filepath.clear(); return S_OK; } return S_FALSE; - case svn_wc_status_normal: - case svn_wc_status_external: - case svn_wc_status_incomplete: + case git_wc_status_normal: + case git_wc_status_external: + case git_wc_status_incomplete: if ((readonlyoverlay)&&(g_readonlyovlloaded)) { if (m_State == FileStateReadOnly) @@ -283,8 +287,8 @@ STDMETHODIMP CShellExt::IsMemberOf(LPCWSTR pwszPath, DWORD /*dwAttrib*/) } else return S_FALSE; - case svn_wc_status_missing: - case svn_wc_status_deleted: + case git_wc_status_missing: + case git_wc_status_deleted: if (g_deletedovlloaded) { if (m_State == FileStateDeleted) @@ -307,9 +311,9 @@ STDMETHODIMP CShellExt::IsMemberOf(LPCWSTR pwszPath, DWORD /*dwAttrib*/) else return S_FALSE; } - case svn_wc_status_replaced: - case svn_wc_status_modified: - case svn_wc_status_merged: + case git_wc_status_replaced: + case git_wc_status_modified: + case git_wc_status_merged: if (m_State == FileStateModified) { g_filepath.clear(); @@ -317,7 +321,7 @@ STDMETHODIMP CShellExt::IsMemberOf(LPCWSTR pwszPath, DWORD /*dwAttrib*/) } else return S_FALSE; - case svn_wc_status_added: + case git_wc_status_added: if (g_addedovlloaded) { if (m_State== FileStateAddedOverlay) @@ -340,8 +344,8 @@ STDMETHODIMP CShellExt::IsMemberOf(LPCWSTR pwszPath, DWORD /*dwAttrib*/) else return S_FALSE; } - case svn_wc_status_conflicted: - case svn_wc_status_obstructed: + case git_wc_status_conflicted: + case git_wc_status_obstructed: if (g_conflictedovlloaded) { if (m_State == FileStateConflict) diff --git a/TortoiseShell/RemoteCacheLink.cpp b/TortoiseShell/RemoteCacheLink.cpp index 60318f7..01292cf 100644 --- a/TortoiseShell/RemoteCacheLink.cpp +++ b/TortoiseShell/RemoteCacheLink.cpp @@ -19,18 +19,20 @@ #include "StdAfx.h" #include "Remotecachelink.h" #include "ShellExt.h" -#include "..\TSVNCache\CacheInterface.h" -#include "TSVNPath.h" +//#include "..\TSVNCache\CacheInterface.h" +//#include "TSVNPath.h" +#define GetCachePipeName() _T("HH") +#define GetCacheCommandPipeName() _T("CC") CRemoteCacheLink::CRemoteCacheLink(void) : m_hPipe(INVALID_HANDLE_VALUE) , m_hCommandPipe(INVALID_HANDLE_VALUE) { - SecureZeroMemory(&m_dummyStatus, sizeof(m_dummyStatus)); - m_dummyStatus.text_status = svn_wc_status_none; - m_dummyStatus.prop_status = svn_wc_status_none; - m_dummyStatus.repos_text_status = svn_wc_status_none; - m_dummyStatus.repos_prop_status = svn_wc_status_none; +// SecureZeroMemory(&m_dummyStatus, sizeof(m_dummyStatus)); +// m_dummyStatus.text_status = svn_wc_status_none; +// m_dummyStatus.prop_status = svn_wc_status_none; +// m_dummyStatus.repos_text_status = svn_wc_status_none; +// m_dummyStatus.repos_prop_status = svn_wc_status_none; m_lastTimeout = 0; m_critSec.Init(); } @@ -191,7 +193,7 @@ void CRemoteCacheLink::CloseCommandPipe() { // now tell the cache we don't need it's command thread anymore DWORD cbWritten; - TSVNCacheCommand cmd; +/* TSVNCacheCommand cmd; SecureZeroMemory(&cmd, sizeof(TSVNCacheCommand)); cmd.command = TSVNCACHECOMMAND_END; WriteFile( @@ -203,6 +205,7 @@ void CRemoteCacheLink::CloseCommandPipe() DisconnectNamedPipe(m_hCommandPipe); CloseHandle(m_hCommandPipe); m_hCommandPipe = INVALID_HANDLE_VALUE; +*/ } } diff --git a/TortoiseShell/RemoteCacheLink.h b/TortoiseShell/RemoteCacheLink.h index 674d209..f8111e0 100644 --- a/TortoiseShell/RemoteCacheLink.h +++ b/TortoiseShell/RemoteCacheLink.h @@ -51,7 +51,7 @@ private: CComCriticalSection m_critSec; - svn_wc_status2_t m_dummyStatus; +// git_wc_status2_t m_dummyStatus; long m_lastTimeout; }; diff --git a/TortoiseShell/ShellCache.h b/TortoiseShell/ShellCache.h index 7cf2964..c5d5639 100644 --- a/TortoiseShell/ShellCache.h +++ b/TortoiseShell/ShellCache.h @@ -1,4 +1,4 @@ -// TortoiseSVN - a Windows shell extension for easy version control +// ToroiseGit - a Windows shell extension for easy version control // Copyright (C) 2003-2008 - Stefan Kueng @@ -19,7 +19,7 @@ #pragma once #include "registry.h" #include "Globals.h" -#include "SVNAdminDir.h" +#include "GitAdminDir.h" #define REGISTRYTIMEOUT 2000 #define EXCLUDELISTTIMEOUT 5000 @@ -46,24 +46,24 @@ public: }; ShellCache() { - cachetype = CRegStdWORD(_T("Software\\TortoiseSVN\\CacheType"), GetSystemMetrics(SM_REMOTESESSION) ? dll : exe); - showrecursive = CRegStdWORD(_T("Software\\TortoiseSVN\\RecursiveOverlay"), TRUE); - folderoverlay = CRegStdWORD(_T("Software\\TortoiseSVN\\FolderOverlay"), TRUE); - driveremote = CRegStdWORD(_T("Software\\TortoiseSVN\\DriveMaskRemote")); - drivefixed = CRegStdWORD(_T("Software\\TortoiseSVN\\DriveMaskFixed"), TRUE); - drivecdrom = CRegStdWORD(_T("Software\\TortoiseSVN\\DriveMaskCDROM")); - driveremove = CRegStdWORD(_T("Software\\TortoiseSVN\\DriveMaskRemovable")); - drivefloppy = CRegStdWORD(_T("Software\\TortoiseSVN\\DriveMaskFloppy")); - driveram = CRegStdWORD(_T("Software\\TortoiseSVN\\DriveMaskRAM")); - driveunknown = CRegStdWORD(_T("Software\\TortoiseSVN\\DriveMaskUnknown")); - excludelist = CRegStdString(_T("Software\\TortoiseSVN\\OverlayExcludeList")); - includelist = CRegStdString(_T("Software\\TortoiseSVN\\OverlayIncludeList")); - simplecontext = CRegStdWORD(_T("Software\\TortoiseSVN\\SimpleContext"), FALSE); - unversionedasmodified = CRegStdWORD(_T("Software\\TortoiseSVN\\UnversionedAsModified"), FALSE); - showunversionedoverlay = CRegStdWORD(_T("Software\\TortoiseSVN\\ShowUnversionedOverlay"), TRUE); - showignoredoverlay = CRegStdWORD(_T("Software\\TortoiseSVN\\ShowIgnoredOverlay"), TRUE); - getlocktop = CRegStdWORD(_T("Software\\TortoiseSVN\\GetLockTop"), TRUE); - excludedasnormal = CRegStdWORD(_T("Software\\TortoiseSVN\\ShowExcludedAsNormal"), TRUE); + cachetype = CRegStdWORD(_T("Software\\ToroiseGit\\CacheType"), GetSystemMetrics(SM_REMOTESESSION) ? dll : exe); + showrecursive = CRegStdWORD(_T("Software\\ToroiseGit\\RecursiveOverlay"), TRUE); + folderoverlay = CRegStdWORD(_T("Software\\ToroiseGit\\FolderOverlay"), TRUE); + driveremote = CRegStdWORD(_T("Software\\ToroiseGit\\DriveMaskRemote")); + drivefixed = CRegStdWORD(_T("Software\\ToroiseGit\\DriveMaskFixed"), TRUE); + drivecdrom = CRegStdWORD(_T("Software\\ToroiseGit\\DriveMaskCDROM")); + driveremove = CRegStdWORD(_T("Software\\ToroiseGit\\DriveMaskRemovable")); + drivefloppy = CRegStdWORD(_T("Software\\ToroiseGit\\DriveMaskFloppy")); + driveram = CRegStdWORD(_T("Software\\ToroiseGit\\DriveMaskRAM")); + driveunknown = CRegStdWORD(_T("Software\\ToroiseGit\\DriveMaskUnknown")); + excludelist = CRegStdString(_T("Software\\ToroiseGit\\OverlayExcludeList")); + includelist = CRegStdString(_T("Software\\ToroiseGit\\OverlayIncludeList")); + simplecontext = CRegStdWORD(_T("Software\\ToroiseGit\\SimpleContext"), FALSE); + unversionedasmodified = CRegStdWORD(_T("Software\\ToroiseGit\\UnversionedAsModified"), FALSE); + showunversionedoverlay = CRegStdWORD(_T("Software\\ToroiseGit\\ShowUnversionedOverlay"), TRUE); + showignoredoverlay = CRegStdWORD(_T("Software\\ToroiseGit\\ShowIgnoredOverlay"), TRUE); + getlocktop = CRegStdWORD(_T("Software\\ToroiseGit\\GetLockTop"), TRUE); + excludedasnormal = CRegStdWORD(_T("Software\\ToroiseGit\\ShowExcludedAsNormal"), TRUE); cachetypeticker = GetTickCount(); recursiveticker = cachetypeticker; folderoverlayticker = cachetypeticker; @@ -82,15 +82,15 @@ public: getlocktopticker = cachetypeticker; excludedasnormalticker = cachetypeticker; excontextticker = cachetypeticker; - menulayoutlow = CRegStdWORD(_T("Software\\TortoiseSVN\\ContextMenuEntries"), MENUCHECKOUT | MENUUPDATE | MENUCOMMIT); - menulayouthigh = CRegStdWORD(_T("Software\\TortoiseSVN\\ContextMenuEntrieshigh"), 0); - menumasklow_lm = CRegStdWORD(_T("Software\\TortoiseSVN\\ContextMenuEntriesMaskLow"), 0, FALSE, HKEY_LOCAL_MACHINE); - menumaskhigh_lm = CRegStdWORD(_T("Software\\TortoiseSVN\\ContextMenuEntriesMaskHigh"), 0, FALSE, HKEY_LOCAL_MACHINE); - menumasklow_cu = CRegStdWORD(_T("Software\\TortoiseSVN\\ContextMenuEntriesMaskLow"), 0); - menumaskhigh_cu = CRegStdWORD(_T("Software\\TortoiseSVN\\ContextMenuEntriesMaskHigh"), 0); - langid = CRegStdWORD(_T("Software\\TortoiseSVN\\LanguageID"), 1033); - blockstatus = CRegStdWORD(_T("Software\\TortoiseSVN\\BlockStatus"), 0); - columnseverywhere = CRegStdWORD(_T("Software\\TortoiseSVN\\ColumnsEveryWhere"), FALSE); + menulayoutlow = CRegStdWORD(_T("Software\\ToroiseGit\\ContextMenuEntries"), MENUCHECKOUT | MENUUPDATE | MENUCOMMIT); + menulayouthigh = CRegStdWORD(_T("Software\\ToroiseGit\\ContextMenuEntrieshigh"), 0); + menumasklow_lm = CRegStdWORD(_T("Software\\ToroiseGit\\ContextMenuEntriesMaskLow"), 0, FALSE, HKEY_LOCAL_MACHINE); + menumaskhigh_lm = CRegStdWORD(_T("Software\\ToroiseGit\\ContextMenuEntriesMaskHigh"), 0, FALSE, HKEY_LOCAL_MACHINE); + menumasklow_cu = CRegStdWORD(_T("Software\\ToroiseGit\\ContextMenuEntriesMaskLow"), 0); + menumaskhigh_cu = CRegStdWORD(_T("Software\\ToroiseGit\\ContextMenuEntriesMaskHigh"), 0); + langid = CRegStdWORD(_T("Software\\ToroiseGit\\LanguageID"), 1033); + blockstatus = CRegStdWORD(_T("Software\\ToroiseGit\\BlockStatus"), 0); + columnseverywhere = CRegStdWORD(_T("Software\\ToroiseGit\\ColumnsEveryWhere"), FALSE); for (int i=0; i<27; i++) { drivetypecache[i] = (UINT)-1; @@ -110,7 +110,7 @@ public: GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_INEGNUMBER, &szBuffer[0], sizeof(szBuffer)); columnrevformat.NegativeOrder = _ttoi(szBuffer); sAdminDirCacheKey.reserve(MAX_PATH); // MAX_PATH as buffer reservation ok. - nocontextpaths = CRegStdString(_T("Software\\TortoiseSVN\\NoContextPaths"), _T("")); + nocontextpaths = CRegStdString(_T("Software\\ToroiseGit\\NoContextPaths"), _T("")); m_critSec.Init(); } void ForceRefresh() @@ -458,7 +458,7 @@ public: return iter->second; } } - BOOL hasAdminDir = g_SVNAdminDir.HasAdminDir(buf, true); + BOOL hasAdminDir = g_GitAdminDir.HasAdminDir(buf, true); admindirticker = GetTickCount(); Locker lock(m_critSec); admindircache[buf] = hasAdminDir; diff --git a/TortoiseShell/ShellExt.cpp b/TortoiseShell/ShellExt.cpp index 088ecba..b3db310 100644 --- a/TortoiseShell/ShellExt.cpp +++ b/TortoiseShell/ShellExt.cpp @@ -25,8 +25,8 @@ #include "Guids.h" #include "ShellExt.h" -#include "..\version.h" -#include "libintl.h" +//#include "..\version.h" +//#include "libintl.h" #undef swprintf std::set g_exts; @@ -104,7 +104,7 @@ void LoadLangDll() if (dirpointA) *dirpointA = 0; strcat_s(langdirA, MAX_PATH, "\\Languages"); - bindtextdomain ("subversion", langdirA); +// bindtextdomain ("subversion", langdirA); do { @@ -154,7 +154,7 @@ void LoadLangDll() (LPVOID *)&lpVersion, &nInfoSize)) { - versionmatch = (_tcscmp((LPCTSTR)lpVersion, _T(STRPRODUCTVER)) == 0); +// versionmatch = (_tcscmp((LPCTSTR)lpVersion, _T(STRPRODUCTVER)) == 0); } } @@ -268,7 +268,7 @@ STDMETHODIMP_(ULONG) CShellExt::Release() // IPersistFile members STDMETHODIMP CShellExt::GetClassID(CLSID *pclsid) { - *pclsid = CLSID_TortoiseSVN_UNCONTROLLED; + *pclsid = CLSID_Tortoisegit_UNCONTROLLED; return S_OK; } @@ -283,7 +283,7 @@ UINT __stdcall CShellExt::CopyCallback(HWND /*hWnd*/, UINT wFunc, UINT /*wFlags* if (wFunc == FO_COPY) return IDYES; // copying is not a problem for us - m_remoteCacheLink.ReleaseLockForPath(CTSVNPath(pszSrcFile)); +// m_remoteCacheLink.ReleaseLockForPath(CTSVNPath(pszSrcFile)); // we could now wait a little bit to give the cache time to release the handles. // but the explorer/shell already retries any action for about two seconds // if it first fails. So if the cache hasn't released the handle yet, the explorer diff --git a/TortoiseShell/ShellExt.h b/TortoiseShell/ShellExt.h index 22521ee..9ab6deb 100644 --- a/TortoiseShell/ShellExt.h +++ b/TortoiseShell/ShellExt.h @@ -23,7 +23,8 @@ #include "resource.h" #include "ShellCache.h" #include "RemoteCacheLink.h" -#include "SVNFolderStatus.h" +#include "GitStatus.h" +//#include "SVNFolderStatus.h" #include "uxtheme.h" extern UINT g_cRefThisDll; // Reference count of this DLL. @@ -33,7 +34,7 @@ extern DWORD g_langid; extern DWORD g_langTimeout; extern HINSTANCE g_hResInst; extern stdstring g_filepath; -extern svn_wc_status_kind g_filestatus; ///< holds the corresponding status to the file/dir above +extern git_wc_status_kind g_filestatus; ///< holds the corresponding status to the file/dir above extern bool g_readonlyoverlay; ///< whether to show the read only overlay or not extern bool g_lockedoverlay; ///< whether to show the locked overlay or not @@ -82,7 +83,7 @@ class CShellExt : public IContextMenu3, { protected: - enum SVNCommands + enum GitCommands { ShellSeparator = 0, ShellSubMenu = 1, @@ -152,7 +153,7 @@ protected: // helper struct for context menu entries typedef struct MenuInfo { - SVNCommands command; ///< the command which gets executed for this menu entry + GitCommands command; ///< the command which gets executed for this menu entry unsigned __int64 menuID; ///< the menu ID to recognize the entry. NULL if it shouldn't be added to the context menu automatically UINT iconID; ///< the icon to show for the menu entry UINT menuTextID; ///< the text of the menu entry @@ -194,11 +195,11 @@ protected: stdstring itemshorturl; stdstring ignoredprops; stdstring owner; - svn_revnum_t columnrev; ///< holds the corresponding revision to the file/dir above - svn_wc_status_kind filestatus; +// git_revnum_t columnrev; ///< holds the corresponding revision to the file/dir above + git_wc_status_kind filestatus; std::map bitmaps; - SVNFolderStatus m_CachedStatus; // status cache +// SVNFolderStatus m_CachedStatus; // status cache CRemoteCacheLink m_remoteCacheLink; FN_GetBufferedPaintBits pfnGetBufferedPaintBits; @@ -207,7 +208,7 @@ protected: #define MAKESTRING(ID) LoadStringEx(g_hResInst, ID, stringtablebuffer, sizeof(stringtablebuffer)/sizeof(TCHAR), (WORD)CRegStdWORD(_T("Software\\TortoiseSVN\\LanguageID"), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT))) private: - void InsertSVNMenu(BOOL istop, HMENU menu, UINT pos, UINT_PTR id, UINT stringid, UINT icon, UINT idCmdFirst, SVNCommands com, UINT uFlags); + void InsertGitMenu(BOOL istop, HMENU menu, UINT pos, UINT_PTR id, UINT stringid, UINT icon, UINT idCmdFirst, GitCommands com, UINT uFlags); void InsertIgnoreSubmenus(UINT &idCmd, UINT idCmdFirst, HMENU hMenu, HMENU subMenu, UINT &indexMenu, int &indexSubMenu, unsigned __int64 topmenu, bool bShowIcons); stdstring WriteFileListToTempFile(); bool WriteClipboardPathsToTempFile(stdstring& tempfile); diff --git a/TortoiseShell/TortoiseSVN.cpp b/TortoiseShell/TortoiseSVN.cpp index 295a91b..40240ed 100644 --- a/TortoiseShell/TortoiseSVN.cpp +++ b/TortoiseShell/TortoiseSVN.cpp @@ -20,7 +20,7 @@ #include "ShellExt.h" #include "Guids.h" #include "ShellExtClassFactory.h" -#include "svn_dso.h" +//#include "git_dso.h" UINT g_cRefThisDll = 0; ///< reference count of this DLL. HINSTANCE g_hmodThisDll = NULL; ///< handle to this DLL itself. @@ -30,7 +30,7 @@ DWORD g_langid; DWORD g_langTimeout = 0; HINSTANCE g_hResInst = NULL; stdstring g_filepath; -svn_wc_status_kind g_filestatus = svn_wc_status_none; ///< holds the corresponding status to the file/dir above +//git_wc_status_kind g_filestatus = git_wc_status_none; ///< holds the corresponding status to the file/dir above bool g_readonlyoverlay = false; bool g_lockedoverlay = false; @@ -109,8 +109,8 @@ DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /* lpReserved */) } while (g_cAprInit--) { - g_SVNAdminDir.Close(); - apr_terminate(); + g_GitAdminDir.Close(); +// apr_terminate(); } } g_csGlobalCOMGuard.Term(); @@ -128,34 +128,34 @@ STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppvOut) *ppvOut = NULL; FileState state = FileStateInvalid; - if (IsEqualIID(rclsid, CLSID_TortoiseSVN_UPTODATE)) + if (IsEqualIID(rclsid, CLSID_Tortoisegit_UPTODATE)) state = FileStateVersioned; - else if (IsEqualIID(rclsid, CLSID_TortoiseSVN_MODIFIED)) + else if (IsEqualIID(rclsid, CLSID_Tortoisegit_MODIFIED)) state = FileStateModified; - else if (IsEqualIID(rclsid, CLSID_TortoiseSVN_CONFLICTING)) + else if (IsEqualIID(rclsid, CLSID_Tortoisegit_CONFLICTING)) state = FileStateConflict; - else if (IsEqualIID(rclsid, CLSID_TortoiseSVN_UNCONTROLLED)) + else if (IsEqualIID(rclsid, CLSID_Tortoisegit_UNCONTROLLED)) state = FileStateUncontrolled; - else if (IsEqualIID(rclsid, CLSID_TortoiseSVN_DROPHANDLER)) + else if (IsEqualIID(rclsid, CLSID_Tortoisegit_DROPHANDLER)) state = FileStateDropHandler; - else if (IsEqualIID(rclsid, CLSID_TortoiseSVN_DELETED)) + else if (IsEqualIID(rclsid, CLSID_Tortoisegit_DELETED)) state = FileStateDeleted; - else if (IsEqualIID(rclsid, CLSID_TortoiseSVN_READONLY)) + else if (IsEqualIID(rclsid, CLSID_Tortoisegit_READONLY)) state = FileStateReadOnly; - else if (IsEqualIID(rclsid, CLSID_TortoiseSVN_LOCKED)) + else if (IsEqualIID(rclsid, CLSID_Tortoisegit_LOCKED)) state = FileStateLockedOverlay; - else if (IsEqualIID(rclsid, CLSID_TortoiseSVN_ADDED)) + else if (IsEqualIID(rclsid, CLSID_Tortoisegit_ADDED)) state = FileStateAddedOverlay; - else if (IsEqualIID(rclsid, CLSID_TortoiseSVN_IGNORED)) + else if (IsEqualIID(rclsid, CLSID_Tortoisegit_IGNORED)) state = FileStateIgnoredOverlay; - else if (IsEqualIID(rclsid, CLSID_TortoiseSVN_UNVERSIONED)) + else if (IsEqualIID(rclsid, CLSID_Tortoisegit_UNVERSIONED)) state = FileStateUnversionedOverlay; if (state != FileStateInvalid) { - apr_initialize(); - svn_dso_initialize2(); - g_SVNAdminDir.Init(); +// apr_initialize(); +// git_dso_initialize2(); +// g_SVNAdminDir.Init(); g_cAprInit++; CShellExtClassFactory *pcf = new CShellExtClassFactory(state); diff --git a/TortoiseShell/TortoiseShell.vcproj b/TortoiseShell/TortoiseShell.vcproj index 88b5d6f..abb1460 100644 --- a/TortoiseShell/TortoiseShell.vcproj +++ b/TortoiseShell/TortoiseShell.vcproj @@ -445,15 +445,15 @@ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm" > - - @@ -533,35 +529,7 @@ - - - - - - - - - - - - - - - - @@ -582,6 +546,14 @@ Filter="h;hpp;hxx;hm;inl;inc" > + + + + @@ -638,39 +610,7 @@ > - - - - - - - - - - - - - - - - + +