From: Frank Li Date: Sat, 23 Jan 2010 12:09:06 +0000 (+0800) Subject: Log can refresh when Click Rev button. X-Git-Url: http://git.osdn.net/view?p=tortoisegit%2FTortoiseGitJp.git;a=commitdiff_plain;h=588f1a6cb8ca51c1318db041bd0f228c84be313e Log can refresh when Click Rev button. Signed-off-by: Frank Li --- diff --git a/src/Git/Git.cpp b/src/Git/Git.cpp index a87114c..3353b54 100644 --- a/src/Git/Git.cpp +++ b/src/Git/Git.cpp @@ -129,6 +129,7 @@ CGit::CGit(void) GetCurrentDirectory(MAX_DIRBUFFER,m_CurrentDir.GetBuffer(MAX_DIRBUFFER)); m_CurrentDir.ReleaseBuffer(); m_IsGitDllInited = false; + m_GitDiff=0; CheckMsysGitDir(); } diff --git a/src/Git/TGitPath.cpp b/src/Git/TGitPath.cpp index 29e6d6a..0f59c32 100644 --- a/src/Git/TGitPath.cpp +++ b/src/Git/TGitPath.cpp @@ -529,7 +529,7 @@ CString CTGitPath::GetRootPathString() const CString CTGitPath::GetFilename() const { - ATLASSERT(!IsDirectory()); + //ATLASSERT(!IsDirectory()); return GetFileOrDirectoryName(); } diff --git a/src/Resources/TortoiseProcENG.rc b/src/Resources/TortoiseProcENG.rc index e53f205..cb59e35 100644 Binary files a/src/Resources/TortoiseProcENG.rc and b/src/Resources/TortoiseProcENG.rc differ diff --git a/src/TortoiseProc/FileDiffDlg.cpp b/src/TortoiseProc/FileDiffDlg.cpp index c9c8fed..0e9a918 100644 --- a/src/TortoiseProc/FileDiffDlg.cpp +++ b/src/TortoiseProc/FileDiffDlg.cpp @@ -34,6 +34,7 @@ #include "CommonResource.h" #include "BrowseRefsDlg.h" #include "LogDlg.h" +#include "RefLogDlg.h" #define ID_COMPARE 1 #define ID_BLAME 2 @@ -287,6 +288,7 @@ UINT CFileDiffDlg::DiffThread() bool bSuccess = true; RefreshCursor(); m_cFileList.ShowText(CString(MAKEINTRESOURCE(IDS_FILEDIFF_WAIT))); + m_cFileList.DeleteAllItems(); m_arFileList.Clear(); #if 0 if (m_bDoPegDiff) @@ -1112,9 +1114,27 @@ void CFileDiffDlg::ClickRevButton(CMenuButton *button, GitRev *rev, CEdit *edit) if(entry == 2) /*RefLog*/ { + CRefLogDlg dlg; + if(dlg.DoModal() == IDOK) + { + if(FillRevFromString(rev,dlg.m_SelectedHash)) + return; + + edit->SetWindowText(dlg.m_SelectedHash); + + }else + return; + } SetURLLabels(); + + InterlockedExchange(&m_bThreadRunning, TRUE); + if (AfxBeginThread(DiffThreadEntry, this)==NULL) + { + InterlockedExchange(&m_bThreadRunning, FALSE); + CMessageBox::Show(NULL, IDS_ERR_THREADSTARTFAILED, IDS_APPNAME, MB_OK | MB_ICONERROR); + } } void CFileDiffDlg::OnBnClickedRev2btn() diff --git a/src/TortoiseProc/RefLogDlg.cpp b/src/TortoiseProc/RefLogDlg.cpp index 3de12cd..03ed5b3 100644 --- a/src/TortoiseProc/RefLogDlg.cpp +++ b/src/TortoiseProc/RefLogDlg.cpp @@ -87,6 +87,20 @@ BOOL CRefLogDlg::OnInitDialog() void CRefLogDlg::OnBnClickedOk() { // TODO: Add your control notification handler code here + if (m_RefList.GetSelectedCount() == 1) + { + // get the selected row + POSITION pos = m_RefList.GetFirstSelectedItemPosition(); + int selIndex = m_RefList.GetNextSelectedItem(pos); + if (selIndex < m_RefList.m_arShownList.GetCount()) + { + // all ok, pick up the revision + GitRev* pLogEntry = reinterpret_cast(m_RefList.m_arShownList.GetAt(selIndex)); + // extract the hash + m_SelectedHash = pLogEntry->m_CommitHash; + } + } + OnOK(); } diff --git a/src/TortoiseProc/RefLogDlg.h b/src/TortoiseProc/RefLogDlg.h index c8b0517..dfbf3f7 100644 --- a/src/TortoiseProc/RefLogDlg.h +++ b/src/TortoiseProc/RefLogDlg.h @@ -27,6 +27,7 @@ public: CString m_CurrentBranch; public: CRefLogList m_RefList; + CString m_SelectedHash; public: afx_msg void OnBnClickedOk(); };