From fb93d481b45b52d818e5546f07eafb879c523436 Mon Sep 17 00:00:00 2001 From: Frank Li Date: Mon, 22 Mar 2010 22:17:26 +0800 Subject: [PATCH] Add TGitCache Test program copy from tortoisesvn 19026 Signed-off-by: Frank Li --- test/Cache/Cache.cpp | 86 +++++++ test/Cache/Cache.h | 46 ++++ test/Cache/Cache.rc | 190 ++++++++++++++++ test/Cache/Cache.vcproj | 354 +++++++++++++++++++++++++++++ test/Cache/CacheDlg.cpp | 510 ++++++++++++++++++++++++++++++++++++++++++ test/Cache/CacheDlg.h | 68 ++++++ test/Cache/res/Cache.ico | Bin 0 -> 21630 bytes test/Cache/res/Cache.manifest | 22 ++ test/Cache/res/Cache.rc2 | 13 ++ test/Cache/resource.h | 25 +++ test/Cache/stdafx.cpp | 7 + test/Cache/stdafx.h | 76 +++++++ 12 files changed, 1397 insertions(+) create mode 100644 test/Cache/Cache.cpp create mode 100644 test/Cache/Cache.h create mode 100644 test/Cache/Cache.rc create mode 100644 test/Cache/Cache.vcproj create mode 100644 test/Cache/CacheDlg.cpp create mode 100644 test/Cache/CacheDlg.h create mode 100644 test/Cache/res/Cache.ico create mode 100644 test/Cache/res/Cache.manifest create mode 100644 test/Cache/res/Cache.rc2 create mode 100644 test/Cache/resource.h create mode 100644 test/Cache/stdafx.cpp create mode 100644 test/Cache/stdafx.h diff --git a/test/Cache/Cache.cpp b/test/Cache/Cache.cpp new file mode 100644 index 000000000..cb1e955b4 --- /dev/null +++ b/test/Cache/Cache.cpp @@ -0,0 +1,86 @@ +// TortoiseSVN - a Windows shell extension for easy version control + +// Copyright (C) 2003-2006 - Stefan Kueng + +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software Foundation, +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +// +#include "stdafx.h" +#include "Cache.h" +#include "CacheDlg.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#endif + + +// CCacheApp + +BEGIN_MESSAGE_MAP(CCacheApp, CWinApp) + ON_COMMAND(ID_HELP, CWinApp::OnHelp) +END_MESSAGE_MAP() + + +// CCacheApp construction + +CCacheApp::CCacheApp() +{ + // TODO: add construction code here, + // Place all significant initialization in InitInstance +} + + +// The one and only CCacheApp object + +CCacheApp theApp; + + +// CCacheApp initialization + +BOOL CCacheApp::InitInstance() +{ + // InitCommonControls() is required on Windows XP if an application + // manifest specifies use of ComCtl32.dll version 6 or later to enable + // visual styles. Otherwise, any window creation will fail. + InitCommonControls(); + + CWinApp::InitInstance(); + + // Standard initialization + // If you are not using these features and wish to reduce the size + // of your final executable, you should remove from the following + // the specific initialization routines you do not need + // Change the registry key under which our settings are stored + // TODO: You should modify this string to be something appropriate + // such as the name of your company or organization + SetRegistryKey(_T("Local AppWizard-Generated Applications")); + + CCacheDlg dlg; + m_pMainWnd = &dlg; + INT_PTR nResponse = dlg.DoModal(); + if (nResponse == IDOK) + { + // TODO: Place code here to handle when the dialog is + // dismissed with OK + } + else if (nResponse == IDCANCEL) + { + // TODO: Place code here to handle when the dialog is + // dismissed with Cancel + } + + // Since the dialog has been closed, return FALSE so that we exit the + // application, rather than start the application's message pump. + return FALSE; +} diff --git a/test/Cache/Cache.h b/test/Cache/Cache.h new file mode 100644 index 000000000..b1a75271f --- /dev/null +++ b/test/Cache/Cache.h @@ -0,0 +1,46 @@ +// TortoiseSVN - a Windows shell extension for easy version control + +// Copyright (C) 2003-2006 - Stefan Kueng + +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software Foundation, +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +// +#pragma once + +#ifndef __AFXWIN_H__ + #error include 'stdafx.h' before including this file for PCH +#endif + +#include "resource.h" // main symbols + + +// CCacheApp: +// See Cache.cpp for the implementation of this class +// + +class CCacheApp : public CWinApp +{ +public: + CCacheApp(); + +// Overrides + public: + virtual BOOL InitInstance(); + +// Implementation + + DECLARE_MESSAGE_MAP() +}; + +extern CCacheApp theApp; \ No newline at end of file diff --git a/test/Cache/Cache.rc b/test/Cache/Cache.rc new file mode 100644 index 000000000..ade08d3f7 --- /dev/null +++ b/test/Cache/Cache.rc @@ -0,0 +1,190 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_CACHE_DIALOG DIALOGEX 0, 0, 320, 129 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | + WS_CAPTION +EXSTYLE WS_EX_APPWINDOW +CAPTION "Cache" +FONT 8, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + DEFPUSHBUTTON "Run Status Test",IDOK,161,106,73,16 + PUSHBUTTON "Cancel",IDCANCEL,38,106,50,16 + LTEXT "Getting Status for:",IDC_STATIC,7,35,81,8 + LTEXT "",IDC_FILEPATH,88,35,225,8 + LTEXT "Done:",IDC_STATIC,7,50,81,8 + LTEXT "",IDC_DONE,88,50,225,8 + LTEXT "Start Time:",IDC_STATIC,7,66,81,8 + LTEXT "",IDC_STARTTIME,88,67,225,8 + LTEXT "End Time:",IDC_STATIC,7,82,81,8 + LTEXT "",IDC_ENDTIME,88,83,225,8 + EDITTEXT IDC_ROOTPATH,7,7,306,14,ES_AUTOHSCROLL + PUSHBUTTON "Run Watcher Test",IDC_WATCHTESTBUTTON,244,108,69,14 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,0,0,1 + PRODUCTVERSION 1,0,0,1 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904e4" + BEGIN + VALUE "CompanyName", "TODO: " + VALUE "FileDescription", "TODO: " + VALUE "FileVersion", "1.0.0.1" + VALUE "InternalName", "Cache.exe" + VALUE "LegalCopyright", "TODO: (c) . All rights reserved." + VALUE "OriginalFilename", "Cache.exe" + VALUE "ProductName", "TODO: " + VALUE "ProductVersion", "1.0.0.1" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1252 + END +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO +BEGIN + IDD_CACHE_DIALOG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 313 + VERTGUIDE, 88 + TOPMARGIN, 7 + BOTTOMMARGIN, 122 + END +END +#endif // APSTUDIO_INVOKED + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// German (Switzerland) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DES) +#ifdef _WIN32 +LANGUAGE LANG_GERMAN, SUBLANG_GERMAN_SWISS +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "#define _AFX_NO_SPLITTER_RESOURCES\r\n" + "#define _AFX_NO_OLE_RESOURCES\r\n" + "#define _AFX_NO_TRACKER_RESOURCES\r\n" + "#define _AFX_NO_PROPERTY_RESOURCES\r\n" + "\r\n" + "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" + "LANGUAGE 9, 1\r\n" + "#pragma code_page(1252)\r\n" + "#include ""res\\Cache.rc2"" // non-Microsoft Visual C++ edited resources\r\n" + "#include ""afxres.rc"" // Standard components\r\n" + "#endif\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDR_MAINFRAME ICON "res\\Cache.ico" +#endif // German (Switzerland) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +#define _AFX_NO_SPLITTER_RESOURCES +#define _AFX_NO_OLE_RESOURCES +#define _AFX_NO_TRACKER_RESOURCES +#define _AFX_NO_PROPERTY_RESOURCES + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE 9, 1 +#pragma code_page(1252) +#include "res\Cache.rc2" // non-Microsoft Visual C++ edited resources +#include "afxres.rc" // Standard components +#endif + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/test/Cache/Cache.vcproj b/test/Cache/Cache.vcproj new file mode 100644 index 000000000..1c511e86c --- /dev/null +++ b/test/Cache/Cache.vcproj @@ -0,0 +1,354 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/Cache/CacheDlg.cpp b/test/Cache/CacheDlg.cpp new file mode 100644 index 000000000..744b94acb --- /dev/null +++ b/test/Cache/CacheDlg.cpp @@ -0,0 +1,510 @@ +// TortoiseSVN - a Windows shell extension for easy version control + +// Copyright (C) 2003-2006, 2009 - TortoiseSVN + +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software Foundation, +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +// +#include "stdafx.h" +#include "Cache.h" +#include "DirFileEnum.h" +#include "CacheInterface.h" +#include +#include ".\cachedlg.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#endif + + + + + +CCacheDlg::CCacheDlg(CWnd* pParent /*=NULL*/) +: CDialog(CCacheDlg::IDD, pParent) +, m_sRootPath(_T("")) +, m_hPipe(INVALID_HANDLE_VALUE) +{ + m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); +} + +void CCacheDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + DDX_Text(pDX, IDC_ROOTPATH, m_sRootPath); +} + +BEGIN_MESSAGE_MAP(CCacheDlg, CDialog) + ON_WM_PAINT() + ON_WM_QUERYDRAGICON() + //}}AFX_MSG_MAP + ON_BN_CLICKED(IDOK, OnBnClickedOk) + ON_BN_CLICKED(IDC_WATCHTESTBUTTON, OnBnClickedWatchtestbutton) +END_MESSAGE_MAP() + + +// CCacheDlg message handlers + +BOOL CCacheDlg::OnInitDialog() +{ + CDialog::OnInitDialog(); + + // Set the icon for this dialog. The framework does this automatically + // when the application's main window is not a dialog + SetIcon(m_hIcon, TRUE); // Set big icon + SetIcon(m_hIcon, FALSE); // Set small icon + + // TODO: Add extra initialization here + + return TRUE; // return TRUE unless you set the focus to a control +} + +// If you add a minimize button to your dialog, you will need the code below +// to draw the icon. For MFC applications using the document/view model, +// this is automatically done for you by the framework. + +void CCacheDlg::OnPaint() +{ + if (IsIconic()) + { + CPaintDC dc(this); // device context for painting + + SendMessage(WM_ICONERASEBKGND, reinterpret_cast(dc.GetSafeHdc()), 0); + + // Center icon in client rectangle + int cxIcon = GetSystemMetrics(SM_CXICON); + int cyIcon = GetSystemMetrics(SM_CYICON); + CRect rect; + GetClientRect(&rect); + int x = (rect.Width() - cxIcon + 1) / 2; + int y = (rect.Height() - cyIcon + 1) / 2; + + // Draw the icon + dc.DrawIcon(x, y, m_hIcon); + } + else + { + CDialog::OnPaint(); + } +} + +// The system calls this function to obtain the cursor to display while the user drags +// the minimized window. +HCURSOR CCacheDlg::OnQueryDragIcon() +{ + return static_cast(m_hIcon); +} + +void CCacheDlg::OnBnClickedOk() +{ + UpdateData(); + AfxBeginThread(TestThreadEntry, this); +} +UINT CCacheDlg::TestThreadEntry(LPVOID pVoid) +{ + return ((CCacheDlg*)pVoid)->TestThread(); +} + +//this is the thread function which calls the subversion function +UINT CCacheDlg::TestThread() +{ + CDirFileEnum direnum(m_sRootPath); + m_filelist.RemoveAll(); + CString filepath; + bool bIsDir = false; + while (direnum.NextFile(filepath, &bIsDir)) + m_filelist.Add(filepath); + + CTime starttime = CTime::GetCurrentTime(); + GetDlgItem(IDC_STARTTIME)->SetWindowText(starttime.Format(_T("%H:%M:%S"))); + int filecounter = 0; + + DWORD startticks = GetTickCount(); + + CString sNumber; + srand(GetTickCount()); + for (int i=0; i < 100000; ++i) + { + CString filepath; + do { + filepath = m_filelist.GetAt(rand() % m_filelist.GetCount()); + } while(filepath.Find(_T(".svn"))>=0); + GetDlgItem(IDC_FILEPATH)->SetWindowText(filepath); + GetStatusFromRemoteCache(CTSVNPath(filepath), true); + sNumber.Format(_T("%d"), i); + GetDlgItem(IDC_DONE)->SetWindowText(sNumber); + if ((GetTickCount()%10)==1) + Sleep(10); + if ((rand()%10)==3) + RemoveFromCache(filepath); + } + CTime endtime = CTime::GetCurrentTime(); + CString sEnd = endtime.Format(_T("%H:%M:%S")); + + DWORD endticks = GetTickCount(); + + CString sEndText; + sEndText.Format(_T("%s - %d ms"), sEnd, endticks-startticks); + + GetDlgItem(IDC_ENDTIME)->SetWindowText(sEndText); + + return 0; +} + + +bool CCacheDlg::EnsurePipeOpen() +{ + if(m_hPipe != INVALID_HANDLE_VALUE) + { + return true; + } + + m_hPipe = CreateFile( + GetCachePipeName(), // pipe name + GENERIC_READ | // read and write access + GENERIC_WRITE, + 0, // no sharing + NULL, // default security attributes + OPEN_EXISTING, // opens existing pipe + FILE_FLAG_OVERLAPPED, // default attributes + NULL); // no template file + + if (m_hPipe == INVALID_HANDLE_VALUE && GetLastError() == ERROR_PIPE_BUSY) + { + // TSVNCache is running but is busy connecting a different client. + // Do not give up immediately but wait for a few milliseconds until + // the server has created the next pipe instance + if (WaitNamedPipe(GetCachePipeName(), 50)) + { + m_hPipe = CreateFile( + GetCachePipeName(), // pipe name + GENERIC_READ | // read and write access + GENERIC_WRITE, + 0, // no sharing + NULL, // default security attributes + OPEN_EXISTING, // opens existing pipe + FILE_FLAG_OVERLAPPED, // default attributes + NULL); // no template file + } + } + + + if (m_hPipe != INVALID_HANDLE_VALUE) + { + // The pipe connected; change to message-read mode. + DWORD dwMode; + + dwMode = PIPE_READMODE_MESSAGE; + if(!SetNamedPipeHandleState( + m_hPipe, // pipe handle + &dwMode, // new pipe mode + NULL, // don't set maximum bytes + NULL)) // don't set maximum time + { + ATLTRACE("SetNamedPipeHandleState failed"); + CloseHandle(m_hPipe); + m_hPipe = INVALID_HANDLE_VALUE; + return false; + } + // create an unnamed (=local) manual reset event for use in the overlapped structure + m_hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); + if (m_hEvent) + return true; + ATLTRACE("CreateEvent failed"); + ClosePipe(); + return false; + } + + return false; +} + + +void CCacheDlg::ClosePipe() +{ + if(m_hPipe != INVALID_HANDLE_VALUE) + { + CloseHandle(m_hPipe); + CloseHandle(m_hEvent); + m_hPipe = INVALID_HANDLE_VALUE; + m_hEvent = INVALID_HANDLE_VALUE; + } +} + +bool CCacheDlg::GetStatusFromRemoteCache(const CTSVNPath& Path, bool bRecursive) +{ + if(!EnsurePipeOpen()) + { + STARTUPINFO startup; + PROCESS_INFORMATION process; + memset(&startup, 0, sizeof(startup)); + startup.cb = sizeof(startup); + memset(&process, 0, sizeof(process)); + + CString sCachePath = _T("TSVNCache.exe"); + if (CreateProcess(sCachePath.GetBuffer(sCachePath.GetLength()+1), _T(""), NULL, NULL, FALSE, 0, 0, 0, &startup, &process)==0) + { + // It's not appropriate to do a message box here, because there may be hundreds of calls + sCachePath.ReleaseBuffer(); + ATLTRACE("Failed to start cache\n"); + return false; + } + sCachePath.ReleaseBuffer(); + + // Wait for the cache to open + long endTime = (long)GetTickCount()+1000; + while(!EnsurePipeOpen()) + { + if(((long)GetTickCount() - endTime) > 0) + { + return false; + } + } + } + + + DWORD nBytesRead; + TSVNCacheRequest request; + request.flags = TSVNCACHE_FLAGS_NONOTIFICATIONS; + if(bRecursive) + { + request.flags |= TSVNCACHE_FLAGS_RECUSIVE_STATUS; + } + wcsncpy(request.path, Path.GetWinPath(), MAX_PATH); + ZeroMemory(&m_Overlapped, sizeof(OVERLAPPED)); + m_Overlapped.hEvent = m_hEvent; + // Do the transaction in overlapped mode. + // That way, if anything happens which might block this call + // we still can get out of it. We NEVER MUST BLOCK THE SHELL! + // A blocked shell is a very bad user impression, because users + // who don't know why it's blocked might find the only solution + // to such a problem is a reboot and therefore they might loose + // valuable data. + // Sure, it would be better to have no situations where the shell + // even can get blocked, but the timeout of 5 seconds is long enough + // so that users still recognize that something might be wrong and + // report back to us so we can investigate further. + + TSVNCacheResponse ReturnedStatus; + BOOL fSuccess = TransactNamedPipe(m_hPipe, + &request, sizeof(request), + &ReturnedStatus, sizeof(ReturnedStatus), + &nBytesRead, &m_Overlapped); + + if (!fSuccess) + { + if (GetLastError()!=ERROR_IO_PENDING) + { + ClosePipe(); + return false; + } + + // TransactNamedPipe is working in an overlapped operation. + // Wait for it to finish + DWORD dwWait = WaitForSingleObject(m_hEvent, INFINITE); + if (dwWait == WAIT_OBJECT_0) + { + fSuccess = GetOverlappedResult(m_hPipe, &m_Overlapped, &nBytesRead, FALSE); + return TRUE; + } + else + fSuccess = FALSE; + } + + ClosePipe(); + return false; +} + +void CCacheDlg::RemoveFromCache(const CString& path) +{ + // if we use the external cache, we tell the cache directly that something + // has changed, without the detour via the shell. + HANDLE hPipe = CreateFile( + GetCacheCommandPipeName(), // pipe name + GENERIC_READ | // read and write access + GENERIC_WRITE, + 0, // no sharing + NULL, // default security attributes + OPEN_EXISTING, // opens existing pipe + FILE_FLAG_OVERLAPPED, // default attributes + NULL); // no template file + + + if (hPipe != INVALID_HANDLE_VALUE) + { + // The pipe connected; change to message-read mode. + DWORD dwMode; + + dwMode = PIPE_READMODE_MESSAGE; + if(SetNamedPipeHandleState( + hPipe, // pipe handle + &dwMode, // new pipe mode + NULL, // don't set maximum bytes + NULL)) // don't set maximum time + { + DWORD cbWritten; + TSVNCacheCommand cmd; + cmd.command = TSVNCACHECOMMAND_CRAWL; + wcsncpy(cmd.path, path, MAX_PATH); + BOOL fSuccess = WriteFile( + hPipe, // handle to pipe + &cmd, // buffer to write from + sizeof(cmd), // number of bytes to write + &cbWritten, // number of bytes written + NULL); // not overlapped I/O + + if (! fSuccess || sizeof(cmd) != cbWritten) + { + DisconnectNamedPipe(hPipe); + CloseHandle(hPipe); + hPipe = INVALID_HANDLE_VALUE; + } + if (hPipe != INVALID_HANDLE_VALUE) + { + // now tell the cache we don't need it's command thread anymore + DWORD cbWritten; + TSVNCacheCommand cmd; + cmd.command = TSVNCACHECOMMAND_END; + WriteFile( + hPipe, // handle to pipe + &cmd, // buffer to write from + sizeof(cmd), // number of bytes to write + &cbWritten, // number of bytes written + NULL); // not overlapped I/O + DisconnectNamedPipe(hPipe); + CloseHandle(hPipe); + hPipe = INVALID_HANDLE_VALUE; + } + } + else + { + ATLTRACE("SetNamedPipeHandleState failed"); + CloseHandle(hPipe); + } + } +} +void CCacheDlg::OnBnClickedWatchtestbutton() +{ + UpdateData(); + AfxBeginThread(WatchTestThreadEntry, this); +} + +UINT CCacheDlg::WatchTestThreadEntry(LPVOID pVoid) +{ + return ((CCacheDlg*)pVoid)->WatchTestThread(); +} + +//this is the thread function which calls the subversion function +UINT CCacheDlg::WatchTestThread() +{ + CDirFileEnum direnum(m_sRootPath); + m_filelist.RemoveAll(); + CString filepath; + bool bIsDir = false; + while (direnum.NextFile(filepath, &bIsDir)) + m_filelist.Add(filepath); + + CTime starttime = CTime::GetCurrentTime(); + GetDlgItem(IDC_STARTTIME)->SetWindowText(starttime.Format(_T("%H:%M:%S"))); + int filecounter = 0; + + DWORD startticks = GetTickCount(); + + CString sNumber; + srand(GetTickCount()); + filepath = m_filelist.GetAt(rand() % m_filelist.GetCount()); + GetStatusFromRemoteCache(CTSVNPath(m_sRootPath), false); + for (int i=0; i < 10000; ++i) + { + filepath = m_filelist.GetAt(rand() % m_filelist.GetCount()); + GetDlgItem(IDC_FILEPATH)->SetWindowText(filepath); + TouchFile(filepath); + CopyRemoveCopy(filepath); + sNumber.Format(_T("%d"), i); + GetDlgItem(IDC_DONE)->SetWindowText(sNumber); + } + + // create dummy directories and remove them again several times + for (int outer = 0; outer<100; ++outer) + { + for (int i=0; i<10; ++i) + { + filepath.Format(_T("__MyDummyFolder%d"), i); + CreateDirectory(m_sRootPath+_T("\\")+filepath, NULL); + HANDLE hFile = CreateFile(m_sRootPath+_T("\\")+filepath+_T("\\file"), GENERIC_READ, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + CloseHandle(hFile); + SHChangeNotify(SHCNE_UPDATEITEM, SHCNF_PATH | SHCNF_FLUSHNOWAIT, m_sRootPath+_T("\\")+filepath+_T("\\file"), NULL); + } + Sleep(500); + for (int i=0; i<10; ++i) + { + filepath.Format(_T("__MyDummyFolder%d"), i); + DeleteFile(m_sRootPath+_T("\\")+filepath+_T("\\file")); + RemoveDirectory(m_sRootPath+_T("\\")+filepath); + } + sNumber.Format(_T("%d"), outer); + GetDlgItem(IDC_DONE)->SetWindowText(sNumber); + } + + CTime endtime = CTime::GetCurrentTime(); + CString sEnd = endtime.Format(_T("%H:%M:%S")); + + DWORD endticks = GetTickCount(); + + CString sEndText; + sEndText.Format(_T("%s - %d ms"), sEnd, endticks-startticks); + + GetDlgItem(IDC_ENDTIME)->SetWindowText(sEndText); + + return 0; +} + +void CCacheDlg::TouchFile(const CString& path) +{ + SetFileAttributes(path, FILE_ATTRIBUTE_NORMAL); + HANDLE hFile = CreateFile(path, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if (hFile == INVALID_HANDLE_VALUE) + return; + + FILETIME ft; + SYSTEMTIME st; + + GetSystemTime(&st); // gets current time + SystemTimeToFileTime(&st, &ft); // converts to file time format + SetFileTime(hFile, // sets last-write time for file + (LPFILETIME) NULL, (LPFILETIME) NULL, &ft); + + CloseHandle(hFile); +} + +void CCacheDlg::CopyRemoveCopy(const CString& path) +{ + if (PathIsDirectory(path)) + return; + if (path.Find(_T(".svn"))>=0) + return; + if (CopyFile(path, path+_T(".tmp"), FALSE)) + { + if (DeleteFile(path)) + { + if (MoveFile(path+_T(".tmp"), path)) + return; + else + MessageBox(_T("could not move file!"), path); + } + else + MessageBox(_T("could not delete file!"), path); + } + else + MessageBox(_T("could not copy file!"), path); +} \ No newline at end of file diff --git a/test/Cache/CacheDlg.h b/test/Cache/CacheDlg.h new file mode 100644 index 000000000..de36c5b90 --- /dev/null +++ b/test/Cache/CacheDlg.h @@ -0,0 +1,68 @@ +// TortoiseSVN - a Windows shell extension for easy version control + +// Copyright (C) 2003-2006 - Stefan Kueng + +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software Foundation, +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +// +#pragma once +#include "TSVNPath.h" + +// CCacheDlg dialog +class CCacheDlg : public CDialog +{ +// Construction +public: + CCacheDlg(CWnd* pParent = NULL); // standard constructor + +// Dialog Data + enum { IDD = IDD_CACHE_DIALOG }; + + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + + +// Implementation +protected: + HICON m_hIcon; + + // Generated message map functions + virtual BOOL OnInitDialog(); + afx_msg void OnPaint(); + afx_msg HCURSOR OnQueryDragIcon(); + afx_msg void OnBnClickedOk(); + afx_msg void OnBnClickedWatchtestbutton(); + + DECLARE_MESSAGE_MAP() + + CString m_sRootPath; + CStringArray m_filelist; + HANDLE m_hPipe; + OVERLAPPED m_Overlapped; + HANDLE m_hEvent; + CComCriticalSection m_critSec; + static UINT TestThreadEntry(LPVOID pVoid); + UINT TestThread(); + void ClosePipe(); + bool EnsurePipeOpen(); + bool GetStatusFromRemoteCache(const CTSVNPath& Path, bool bRecursive); + void RemoveFromCache(const CString& path); + + void TouchFile(const CString& path); + void CopyRemoveCopy(const CString& path); + + static UINT WatchTestThreadEntry(LPVOID pVoid); + UINT WatchTestThread(); +public: +}; diff --git a/test/Cache/res/Cache.ico b/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+ + + + diff --git a/test/Cache/res/Cache.rc2 b/test/Cache/res/Cache.rc2 new file mode 100644 index 000000000..3eb989955 --- /dev/null +++ b/test/Cache/res/Cache.rc2 @@ -0,0 +1,13 @@ +// +// Cache.RC2 - resources Microsoft Visual C++ does not edit directly +// + +#ifdef APSTUDIO_INVOKED +#error this file is not editable by Microsoft Visual C++ +#endif //APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// Add manually edited resources here... + +///////////////////////////////////////////////////////////////////////////// diff --git a/test/Cache/resource.h b/test/Cache/resource.h new file mode 100644 index 000000000..2ecae5e35 --- /dev/null +++ b/test/Cache/resource.h @@ -0,0 +1,25 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by Cache.rc +// +#define IDD_CACHE_DIALOG 102 +#define IDR_MAINFRAME 128 +#define IDC_FILEPATH 1000 +#define IDC_DONE 1001 +#define IDC_STARTTIME 1002 +#define IDC_ENDTIME 1003 +#define IDC_EDIT1 1004 +#define IDC_ROOTPATH 1004 +#define IDC_BUTTON1 1005 +#define IDC_WATCHTESTBUTTON 1005 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 129 +#define _APS_NEXT_COMMAND_VALUE 32771 +#define _APS_NEXT_CONTROL_VALUE 1006 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/test/Cache/stdafx.cpp b/test/Cache/stdafx.cpp new file mode 100644 index 000000000..20bdd174a --- /dev/null +++ b/test/Cache/stdafx.cpp @@ -0,0 +1,7 @@ +// stdafx.cpp : source file that includes just the standard includes +// Cache.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + + diff --git a/test/Cache/stdafx.h b/test/Cache/stdafx.h new file mode 100644 index 000000000..e31c7184b --- /dev/null +++ b/test/Cache/stdafx.h @@ -0,0 +1,76 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +#define _WIN32_IE 0x600 + +#ifdef UNICODE +# ifndef WINVER +# define WINVER 0x0501 +# endif +# ifndef _WIN32_WINNT +# define _WIN32_WINNT 0x0501 +# endif +# ifndef _WIN32_WINDOWS +# define _WIN32_WINDOWS 0x0501 +# endif +#else +# ifndef WINVER +# define WINVER 0x0410 +# endif +# ifndef _WIN32_WINNT +# define _WIN32_WINNT 0x0500 +# endif +# ifndef _WIN32_WINDOWS +# define _WIN32_WINDOWS 0x0410 +# endif +#endif + +#define _AFX_ALL_WARNINGS + +#include // MFC core and standard components +#include // MFC extensions + +#include // MFC support for Internet Explorer 4 Common Controls +#ifndef _AFX_NO_AFXCMN_SUPPORT +#include // MFC support for Windows Common Controls +#endif // _AFX_NO_AFXCMN_SUPPORT +#include +#include +#include +#include + + +#include +#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit + +#include + +#include + +// TODO: reference additional headers your program requires here + +#define CSTRING_AVAILABLE + + +using namespace ATL; + +#pragma warning(push) +#pragma warning(disable: 4702) // Unreachable code warnings in xtree +#include +#include +#include +#include +#include +#pragma warning(pop) + +#include "svn_wc.h" +#include "svn_client.h" +#include "svn_path.h" +#include "svn_pools.h" + + +typedef CComCritSecLock AutoLocker; -- 2.11.4.GIT