From 588f1a6cb8ca51c1318db041bd0f228c84be313e Mon Sep 17 00:00:00 2001 From: Frank Li Date: Sat, 23 Jan 2010 20:09:06 +0800 Subject: [PATCH] Log can refresh when Click Rev button. Signed-off-by: Frank Li --- src/Git/Git.cpp | 1 + src/Git/TGitPath.cpp | 2 +- src/Resources/TortoiseProcENG.rc | Bin 453778 -> 453818 bytes src/TortoiseProc/FileDiffDlg.cpp | 20 ++++++++++++++++++++ src/TortoiseProc/RefLogDlg.cpp | 14 ++++++++++++++ src/TortoiseProc/RefLogDlg.h | 1 + 6 files changed, 37 insertions(+), 1 deletion(-) 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 e53f205bca10d315a48d6228f591cb9683b9f6b3..cb59e35e1c696a2511b87ff2ab2d3f9010c4e7d9 100644 GIT binary patch delta 93 zcmbPqQ+n4;>4q(gFE$A)FlaF3F{Cn-Gbk|RgISu>A964XZ~wK4QGp38ozIZNkb)%5 cxQ$V?U2iKR5HkTWGZ3=?G3$1{t!ydg01f6FGXMYp delta 48 ycmdmWQ+m=(>4q(gFE&ko#K9=Eoo_Rv0#m!wRz@HO(ab>10>rG_owl-7m;(Uy-xC`E 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(); }; -- 2.11.0