From 8b20104fa5e13aea66727e75797ffea809cef1fe Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Sun, 10 Mar 2013 22:39:30 +0100 Subject: [PATCH] Dropped code for SVN specific hooks Signed-off-by: Sven Strickroth --- Languages/Tortoise.pot | 12 --------- src/Resources/TortoiseProcENG.rc | 7 ----- src/TortoiseProc/resource.h | 3 --- src/Utils/Hooks.cpp | 54 +------------------------------------- src/Utils/Hooks.h | 56 ++-------------------------------------- 5 files changed, 3 insertions(+), 129 deletions(-) diff --git a/Languages/Tortoise.pot b/Languages/Tortoise.pot index aa55932a4..5883398ca 100644 --- a/Languages/Tortoise.pot +++ b/Languages/Tortoise.pot @@ -6206,10 +6206,6 @@ msgstr "" msgid "Post-Push Hook" msgstr "" -#. Resource IDs: (570) -msgid "Post-Update Hook" -msgstr "" - #. Resource IDs: (58115) msgid "Pre&v Page" msgstr "" @@ -6222,10 +6218,6 @@ msgstr "" msgid "Pre-Push Hook" msgstr "" -#. Resource IDs: (570) -msgid "Pre-Update Hook" -msgstr "" - #. Resource IDs: (68) msgid "Preparing commit..." msgstr "" @@ -7734,10 +7726,6 @@ msgstr "" msgid "Start Rebase" msgstr "" -#. Resource IDs: (569) -msgid "Start Update Hook" -msgstr "" - #. Resource IDs: (12) msgid "Start bisect mode..." msgstr "" diff --git a/src/Resources/TortoiseProcENG.rc b/src/Resources/TortoiseProcENG.rc index 451c69b85..1d511dc55 100644 --- a/src/Resources/TortoiseProcENG.rc +++ b/src/Resources/TortoiseProcENG.rc @@ -3666,13 +3666,6 @@ BEGIN IDS_HOOKTYPE_STARTCOMMIT "Start Commit Hook" IDS_HOOKTYPE_PRECOMMIT "Pre-Commit Hook" IDS_HOOKTYPE_POSTCOMMIT "Post-Commit Hook" - IDS_HOOKTYPE_STARTUPDATE "Start Update Hook" -END - -STRINGTABLE -BEGIN - IDS_HOOKTYPE_PREUPDATE "Pre-Update Hook" - IDS_HOOKTYPE_POSTUPDATE "Post-Update Hook" END STRINGTABLE diff --git a/src/TortoiseProc/resource.h b/src/TortoiseProc/resource.h index 6cfada614..0f168d6b7 100644 --- a/src/TortoiseProc/resource.h +++ b/src/TortoiseProc/resource.h @@ -1598,9 +1598,6 @@ #define IDS_HOOKTYPE_STARTCOMMIT 9100 #define IDS_HOOKTYPE_PRECOMMIT 9101 #define IDS_HOOKTYPE_POSTCOMMIT 9102 -#define IDS_HOOKTYPE_STARTUPDATE 9103 -#define IDS_HOOKTYPE_PREUPDATE 9104 -#define IDS_HOOKTYPE_POSTUPDATE 9105 #define IDS_TT_RECURSIVE 9290 #define IDS_STATUSLIST_COLADD 9603 #define IDS_STATUSLIST_COLDEL 9604 diff --git a/src/Utils/Hooks.cpp b/src/Utils/Hooks.cpp index 8fbb321ef..8a6755d0f 100644 --- a/src/Utils/Hooks.cpp +++ b/src/Utils/Hooks.cpp @@ -1,5 +1,6 @@ // TortoiseGit - a Windows shell extension for easy version control +// Copyright (C) 2011-2013 - TortoiseGit // Copyright (C) 2007-2008 - TortoiseSVN // This program is free software; you can redistribute it and/or @@ -168,12 +169,6 @@ CString CHooks::GetHookTypeString(hooktype t) return _T("pre_commit_hook"); case post_commit_hook: return _T("post_commit_hook"); - case start_update_hook: - return _T("start_update_hook"); - case pre_update_hook: - return _T("pre_update_hook"); - case post_update_hook: - return _T("post_update_hook"); case pre_push_hook: return _T("pre_push_hook"); case post_push_hook: @@ -190,12 +185,6 @@ hooktype CHooks::GetHookType(const CString& s) return pre_commit_hook; if (s.Compare(_T("post_commit_hook"))==0) return post_commit_hook; - if (s.Compare(_T("start_update_hook"))==0) - return start_update_hook; - if (s.Compare(_T("pre_update_hook"))==0) - return pre_update_hook; - if (s.Compare(_T("post_update_hook"))==0) - return post_update_hook; if (s.Compare(_T("pre_push_hook"))==0) return pre_push_hook; if (s.Compare(_T("post_push_hook"))==0) @@ -294,47 +283,6 @@ bool CHooks::PostCommit(const CTGitPathList& pathList, git_depth_t depth, GitRev return true; } -bool CHooks::StartUpdate(const CTGitPathList& pathList, DWORD& exitcode, CString& error) -{ - hookiterator it = FindItem(start_update_hook, pathList); - if (it == end()) - return false; - CString sCmd = it->second.commandline; - AddPathParam(sCmd, pathList); - AddCWDParam(sCmd, pathList); - exitcode = RunScript(sCmd, pathList.GetCommonRoot().GetDirectory().GetWinPath(), error, it->second.bWait, it->second.bShow); - return true; -} - -bool CHooks::PreUpdate(const CTGitPathList& pathList, git_depth_t depth, GitRev rev, DWORD& exitcode, CString& error) -{ - hookiterator it = FindItem(pre_update_hook, pathList); - if (it == end()) - return false; - CString sCmd = it->second.commandline; - AddPathParam(sCmd, pathList); - AddDepthParam(sCmd, depth); - AddParam(sCmd, rev.m_CommitHash.ToString()); - AddCWDParam(sCmd, pathList); - exitcode = RunScript(sCmd, pathList.GetCommonRoot().GetDirectory().GetWinPath(), error, it->second.bWait, it->second.bShow); - return true; -} - -bool CHooks::PostUpdate(const CTGitPathList& pathList, git_depth_t depth, GitRev rev, DWORD& exitcode, CString& error) -{ - hookiterator it = FindItem(post_update_hook, pathList); - if (it == end()) - return false; - CString sCmd = it->second.commandline; - AddPathParam(sCmd, pathList); - AddDepthParam(sCmd, depth); - AddParam(sCmd, rev.m_CommitHash.ToString()); - AddErrorParam(sCmd, error); - AddCWDParam(sCmd, pathList); - exitcode = RunScript(sCmd, pathList.GetCommonRoot().GetDirectory().GetWinPath(), error, it->second.bWait, it->second.bShow); - return true; -} - bool CHooks::PrePush(const CTGitPathList& pathList,DWORD& exitcode, CString& error) { hookiterator it = FindItem(pre_push_hook, pathList); diff --git a/src/Utils/Hooks.h b/src/Utils/Hooks.h index 27f1b2f76..db39293e8 100644 --- a/src/Utils/Hooks.h +++ b/src/Utils/Hooks.h @@ -1,6 +1,7 @@ // TortoiseGit - a Windows shell extension for easy version control -// Copyright (C) 2006-2008 - TortoiseGit +// Copyright (C) 2011-2013 - TortoiseGit +// Copyright (C) 2006-2008 - TortoiseSVN // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -33,9 +34,6 @@ typedef enum hooktype start_commit_hook, pre_commit_hook, post_commit_hook, - start_update_hook, - pre_update_hook, - post_update_hook, issue_tracker_hook, pre_push_hook, post_push_hook, @@ -118,56 +116,6 @@ public: static hooktype GetHookType(const CString& s); /** - * Executes the Start-Update-Hook that first matches one of the paths in - * \c pathList. - * \param pathList a list of paths to look for the hook scripts - * \param exitcode on return, contains the exit code of the hook script - * \param error the data the hook script outputs to stderr - * \remark the string "%PATHS% in the command line of the hook script is - * replaced with the path to a temporary file which contains a list of files - * in \c pathList, separated by newlines. The hook script can parse this - * file to get all the paths the update is about to be done on. - */ - bool StartUpdate(const CTGitPathList& pathList, DWORD& exitcode, - CString& error); - /** - * Executes the Pre-Update-Hook that first matches one of the paths in - * \c pathList. - * \param pathList a list of paths to look for the hook scripts - * \param depth the depth of the commit - * \param rev the revision the update is done to - * \param exitcode on return, contains the exit code of the hook script - * \param error the data the hook script outputs to stderr - * \remark the string "%PATHS% in the command line of the hook script is - * replaced with the path to a temporary file which contains a list of files - * in \c pathList, separated by newlines. The hook script can parse this - * file to get all the paths the update is about to be done on. - * The string "%RECURSIVE%" is replaced with either "recursive" or "nonrecursive" according - * to the \c bRecursive parameter. And the string "%REVISION%" is replaced with - * the string representation of \c rev. - */ - bool PreUpdate(const CTGitPathList& pathList, git_depth_t depth, - GitRev rev, DWORD& exitcode, CString& error); - /** - * Executes the Post-Update-Hook that first matches one of the paths in - * \c pathList. - * \param pathList a list of paths to look for the hook scripts - * \param depth the depth of the commit - * \param rev the revision the update was done to - * \param exitcode on return, contains the exit code of the hook script - * \param error the data the hook script outputs to stderr - * \remark the string "%PATHS% in the command line of the hook script is - * replaced with the path to a temporary file which contains a list of files - * in \c pathList, separated by newlines. The hook script can parse this - * file to get all the paths the update is about to be done on. - * The string "%RECURSIVE%" is replaced with either "recursive" or "nonrecursive" according - * to the \c bRecursive parameter. And the string "%REVISION%" is replaced with - * the string representation of \c rev. - */ - bool PostUpdate(const CTGitPathList& pathList, git_depth_t depth, - GitRev rev, DWORD& exitcode, CString& error); - - /** * Executes the Start-Commit-Hook that first matches one of the paths in * \c pathList. * \param pathList a list of paths to look for the hook scripts -- 2.11.4.GIT