1 // TortoiseSVN - a Windows shell extension for easy version control
3 // External Cache Copyright (C) 2005-2006,2008 - TortoiseSVN
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software Foundation,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 #include "GitStatus.h"
24 // The name of the named-pipe for the cache
26 #define TSVN_CACHE_PIPE_NAME _T("\\\\.\\pipe\\TGitCache64")
27 #define TSVN_CACHE_COMMANDPIPE_NAME _T("\\\\.\\pipe\\TGitCacheCommand64")
28 #define TSVN_CACHE_WINDOW_NAME _T("TGitCacheWindow64")
29 #define TSVN_CACHE_MUTEX_NAME _T("TGitCacheMutex64")
31 #define TSVN_CACHE_PIPE_NAME _T("\\\\.\\pipe\\TGitCache")
32 #define TSVN_CACHE_COMMANDPIPE_NAME _T("\\\\.\\pipe\\TGitCacheCommand")
33 #define TSVN_CACHE_WINDOW_NAME _T("TGitCacheWindow")
34 #define TSVN_CACHE_MUTEX_NAME _T("TGitCacheMutex")
37 CString
GetCachePipeName();
38 CString
GetCacheCommandPipeName();
39 CString
GetCacheMutexName();
44 typedef enum git_node_kind_t
56 * A structure passed as a request from the shell (or other client) to the external cache
58 struct TSVNCacheRequest
61 WCHAR path
[MAX_PATH
+1];
64 // CustomActions will use this header but does not need nor understand the SVN types ...
70 * The structure returned as a response
72 struct TSVNCacheResponse
74 git_wc_status2_t m_status
;
75 git_wc_entry_t m_entry
;
76 git_node_kind_t m_kind
;
77 char m_url
[INTERNET_MAX_URL_LENGTH
+1];
78 char m_owner
[255]; ///< owner of the lock
80 bool m_readonly
; ///< whether the file is write protected or not
81 bool m_needslock
; ///< whether the file has the svn:needs-lock property set or not (only works with the new working copy version)
90 struct TSVNCacheCommand
92 BYTE command
; ///< the command to execute
93 WCHAR path
[MAX_PATH
+1]; ///< path to do the command for
96 #define TSVNCACHECOMMAND_END 0 ///< ends the thread handling the pipe communication
97 #define TSVNCACHECOMMAND_CRAWL 1 ///< start crawling the specified path for changes
98 #define TSVNCACHECOMMAND_REFRESHALL 2 ///< Refreshes the whole cache, usually necessary after the "treat unversioned files as modified" option changed.
99 #define TSVNCACHECOMMAND_RELEASE 3 ///< Releases all open handles for the specified path and all paths below
102 /// Set this flag if you already know whether or not the item is a folder
103 #define TSVNCACHE_FLAGS_FOLDERISKNOWN 0x01
104 /// Set this flag if the item is a folder
105 #define TSVNCACHE_FLAGS_ISFOLDER 0x02
106 /// Set this flag if you want recursive folder status (safely ignored for file paths)
107 #define TSVNCACHE_FLAGS_RECUSIVE_STATUS 0x04
108 /// Set this flag if notifications to the shell are not allowed
109 #define TSVNCACHE_FLAGS_NONOTIFICATIONS 0x08