bool CHooks::PrePush(const CString& workingTree, DWORD& exitcode, CString& error) { auto it = FindItem(pre_push_hook, workingTree); if (it == end()) return false; CString sCmd = it->second.commandline; AddPathParam(sCmd, CTGitPathList(workingTree)); AddErrorParam(sCmd, error); AddCWDParam(sCmd, workingTree); exitcode = RunScript(sCmd, workingTree, 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); if (it == end()) return false; CString sCmd = it->second.commandline; AddPathParam(sCmd, pathList); AddErrorParam(sCmd, error); AddCWDParam(sCmd, pathList); exitcode = RunScript(sCmd, pathList.GetCommonRoot().GetDirectory().GetWinPath(), error, it->second.bWait, it->second.bShow); return true; }
bool CHooks::PreRebase(const CString& workingTree, const CString& upstream, const CString& rebasedBranch, DWORD& exitcode, CString& error) { auto it = FindItem(pre_rebase_hook, workingTree); if (it == end()) return false; CString sCmd = it->second.commandline; AddParam(sCmd, upstream); AddParam(sCmd, rebasedBranch); AddErrorParam(sCmd, error); AddCWDParam(sCmd, workingTree); exitcode = RunScript(sCmd, workingTree, 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::PostCommit(const CString& workingTree, const CTGitPathList& pathList, const GitRev& rev, const CString& message, DWORD& exitcode, CString& error) { auto it = FindItem(post_commit_hook, workingTree); if (it == end()) return false; CString sCmd = it->second.commandline; AddPathParam(sCmd, pathList); AddMessageFileParam(sCmd, message); AddParam(sCmd, rev.m_CommitHash.ToString()); AddErrorParam(sCmd, error); AddCWDParam(sCmd, workingTree); exitcode = RunScript(sCmd, workingTree, error, it->second.bWait, it->second.bShow); return true; }
bool CHooks::PostLock(HWND hWnd, const CTSVNPathList & pathList, bool lock, bool steal, const CString & message, DWORD & exitcode, CString & error) { hookiterator it = FindItem(post_lock_hook, pathList); if (it == end()) return false; if (!ApproveHook(hWnd, it)) return false; CString sCmd = it->second.commandline; AddPathParam(sCmd, pathList); AddParam(sCmd, lock ? L"true" : L"false"); AddParam(sCmd, steal ? L"true" : L"false"); AddMessageFileParam(sCmd, message); AddErrorParam(sCmd, error); AddCWDParam(sCmd, pathList); exitcode = RunScript(sCmd, pathList, error, it->second.bWait, it->second.bShow); return true; }
bool CHooks::PostUpdate(HWND hWnd, const CTSVNPathList& pathList, svn_depth_t depth, const SVNRev& rev, const CTSVNPathList& updatedList, DWORD& exitcode, CString& error) { hookiterator it = FindItem(post_update_hook, pathList); if (it == end()) return false; if (!ApproveHook(hWnd, it)) return false; CString sCmd = it->second.commandline; AddPathParam(sCmd, pathList); AddDepthParam(sCmd, depth); AddParam(sCmd, rev.ToString()); AddErrorParam(sCmd, error); AddCWDParam(sCmd, pathList); AddPathParam(sCmd, updatedList); exitcode = RunScript(sCmd, pathList, error, it->second.bWait, it->second.bShow); return true; }