#include "ShellUpdater.h"\r
#include "Commands/PushCommand.h"\r
#include "PatchViewDlg.h"\r
+#include "COMError.h"\r
\r
#ifdef _DEBUG\r
#define new DEBUG_NEW\r
return;\r
}\r
\r
+ m_ListCtrl.WriteCheckedNamesToPathList(m_selectedPathList);\r
#if 0\r
CRegDWORD regUnversionedRecurse (_T("Software\\TortoiseGit\\UnversionedRecurse"), TRUE);\r
if (!(DWORD)regUnversionedRecurse)\r
//std::set<CString> checkedLists;\r
//std::set<CString> uncheckedLists;\r
\r
+ // now let the bugtraq plugin check the commit message\r
+ CComPtr<IBugTraqProvider2> pProvider2 = NULL;\r
+ if (m_BugTraqProvider)\r
+ {\r
+ HRESULT hr = m_BugTraqProvider.QueryInterface(&pProvider2);\r
+ if (SUCCEEDED(hr))\r
+ {\r
+ BSTR temp = NULL;\r
+ CString common = g_Git.m_CurrentDir;\r
+ BSTR repositoryRoot = common.AllocSysString();\r
+ BSTR parameters = m_bugtraq_association.GetParameters().AllocSysString();\r
+ BSTR commonRoot = SysAllocString(m_pathList.GetCommonRoot().GetDirectory().GetWinPath());\r
+ BSTR commitMessage = m_sLogMessage.AllocSysString();\r
+ SAFEARRAY *pathList = SafeArrayCreateVector(VT_BSTR, 0, m_selectedPathList.GetCount());\r
+\r
+ for (LONG index = 0; index < m_selectedPathList.GetCount(); ++index)\r
+ SafeArrayPutElement(pathList, &index, m_selectedPathList[index].GetGitPathString().AllocSysString());\r
+\r
+ if (FAILED(hr = pProvider2->CheckCommit(GetSafeHwnd(), parameters, repositoryRoot, commonRoot, pathList, commitMessage, &temp)))\r
+ {\r
+ COMError ce(hr);\r
+ CString sErr;\r
+ sErr.Format(IDS_ERR_FAILEDISSUETRACKERCOM, m_bugtraq_association.GetProviderName(), ce.GetMessageAndDescription().c_str());\r
+ CMessageBox::Show(m_hWnd, sErr, _T("TortoiseSVN"), MB_ICONERROR);\r
+ }\r
+ else\r
+ {\r
+ CString sError = temp;\r
+ if (!sError.IsEmpty())\r
+ {\r
+ CMessageBox::Show(m_hWnd, sError, _T("TortoiseSVN"), MB_ICONERROR);\r
+ return;\r
+ }\r
+ SysFreeString(temp);\r
+ }\r
+ }\r
+ }\r
+\r
//CString checkedfiles;\r
//CString uncheckedfiles;\r
\r
//User pressed 'Push' button after successful commit.\r
m_bPushAfterCommit=true;\r
}\r
-\r
+ \r
CFile::Remove(tempfile);\r
+\r
+ if (m_BugTraqProvider && progress.m_GitStatus == 0)\r
+ {\r
+ CComPtr<IBugTraqProvider2> pProvider = NULL;\r
+ HRESULT hr = m_BugTraqProvider.QueryInterface(&pProvider);\r
+ if (SUCCEEDED(hr))\r
+ {\r
+ BSTR commonRoot = SysAllocString(g_Git.m_CurrentDir);\r
+ SAFEARRAY *pathList = SafeArrayCreateVector(VT_BSTR, 0,this->m_selectedPathList.GetCount());\r
+\r
+ for (LONG index = 0; index < m_selectedPathList.GetCount(); ++index)\r
+ SafeArrayPutElement(pathList, &index, m_selectedPathList[index].GetGitPathString().AllocSysString());\r
+\r
+ BSTR logMessage = m_sLogMessage.AllocSysString();\r
+\r
+ CString hash=g_Git.GetHash(CString(_T("HEAD")));\r
+ LONG version = g_Git.Hash2int(hash);\r
+\r
+ BSTR temp = NULL;\r
+ if (FAILED(hr = pProvider->OnCommitFinished(GetSafeHwnd(), \r
+ commonRoot,\r
+ pathList,\r
+ logMessage,\r
+ (LONG)version,\r
+ &temp)))\r
+ {\r
+ CString sErr = temp;\r
+ if (!sErr.IsEmpty())\r
+ CMessageBox::Show(NULL,(sErr),_T("TortoiseGit"),MB_OK|MB_ICONERROR);\r
+ else\r
+ {\r
+ COMError ce(hr);\r
+ sErr.Format(IDS_ERR_FAILEDISSUETRACKERCOM, ce.GetSource().c_str(), ce.GetMessageAndDescription().c_str());\r
+ CMessageBox::Show(NULL,(sErr),_T("TortoiseGit"),MB_OK|MB_ICONERROR);\r
+ }\r
+ }\r
+\r
+ SysFreeString(temp);\r
+ }\r
+ }\r
+ \r
}else\r
{\r
CMessageBox::Show(this->m_hWnd, IDS_ERROR_NOTHING_COMMIT, IDS_COMMIT_FINISH, MB_OK | MB_ICONINFORMATION);\r
//save only the files the user has checked into the temporary file\r
m_ListCtrl.WriteCheckedNamesToPathList(m_pathList);\r
}\r
- m_ListCtrl.WriteCheckedNamesToPathList(m_selectedPathList);\r
+ \r
// the item count is used in the progress dialog to show the overall commit\r
// progress.\r
// deleted items only send one notification event, all others send two\r