From ba21b546932a8b348c7d2cfd8d485d994c6a7766 Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Sat, 12 Jan 2013 23:48:51 +0100 Subject: [PATCH] Fixed issue #1285: Show Log Filter on Tags Signed-off-by: Sven Strickroth --- src/Changelog.txt | 1 + src/TortoiseProc/GitLogListBase.cpp | 48 +++++++++++++++++++++++++++++++++++++ src/TortoiseProc/GitLogListBase.h | 2 +- src/TortoiseProc/LogDlg.cpp | 3 +++ 4 files changed, 53 insertions(+), 1 deletion(-) diff --git a/src/Changelog.txt b/src/Changelog.txt index 7b14d5ccf..0770c1e70 100644 --- a/src/Changelog.txt +++ b/src/Changelog.txt @@ -31,6 +31,7 @@ Released: unreleased * Added search mechanism to reflog dialog * Add No fetch, Merge and Rebase options in Submodule Update Dialog * Fixed issue #1467: put remote branches at the bottom in "branches" dropdowns (can be disabled using advanced settings) + * Fixed issue #1285: Show Log Filter on Tags == Bug Fix == * Fixed issue #1535: Unclear UI in prompt dialog of Stash Save diff --git a/src/TortoiseProc/GitLogListBase.cpp b/src/TortoiseProc/GitLogListBase.cpp index c3a01b8c9..8959af230 100644 --- a/src/TortoiseProc/GitLogListBase.cpp +++ b/src/TortoiseProc/GitLogListBase.cpp @@ -2871,6 +2871,18 @@ BOOL CGitLogListBase::IsMatchFilter(bool bRegex, GitRev *pRev, tr1::wregex &pat) } } + if (m_SelectedFilters & LOGFILTER_REFNAME) + { + STRING_VECTOR refs = m_HashMap[pRev->m_CommitHash]; + for (auto it = refs.cbegin(); it != refs.cend(); ++it) + { + if (regex_search(wstring((LPCTSTR)*it), pat, flags)) + { + return TRUE; + } + } + } + if (m_SelectedFilters & LOGFILTER_PATHS) { CTGitPathList *pathList=NULL; @@ -2964,6 +2976,18 @@ BOOL CGitLogListBase::IsMatchFilter(bool bRegex, GitRev *pRev, tr1::wregex &pat) } } + if (m_SelectedFilters & LOGFILTER_REFNAME) + { + STRING_VECTOR refs = m_HashMap[pRev->m_CommitHash]; + for (auto it = refs.cbegin(); it != refs.cend(); ++it) + { + if (it->Find(find) >= 0) + { + return TRUE; + } + } + } + if (m_SelectedFilters & LOGFILTER_PATHS) { CTGitPathList *pathList=NULL; @@ -3097,6 +3121,18 @@ void CGitLogListBase::RecalculateShownList(CThreadSafePtrArray * pShownlist) continue; } } + if (m_SelectedFilters & LOGFILTER_REFNAME) + { + STRING_VECTOR refs = m_HashMap[m_logEntries.GetGitRevAt(i).m_CommitHash]; + for (auto it = refs.cbegin(); it != refs.cend(); ++it) + { + if (regex_search(wstring((LPCTSTR)*it), pat, flags) && IsEntryInDateRange(i)) + { + pShownlist->SafeAdd(&m_logEntries.GetGitRevAt(i)); + continue; + } + } + } } // if (bRegex) else { @@ -3190,6 +3226,18 @@ void CGitLogListBase::RecalculateShownList(CThreadSafePtrArray * pShownlist) continue; } } + if (m_SelectedFilters & LOGFILTER_REFNAME) + { + STRING_VECTOR refs = m_HashMap[m_logEntries.GetGitRevAt(i).m_CommitHash]; + for (auto it = refs.cbegin(); it != refs.cend(); ++it) + { + if (it->Find(find) >= 0 && IsEntryInDateRange(i)) + { + pShownlist->SafeAdd(&m_logEntries.GetGitRevAt(i)); + continue; + } + } + } } // else (from if (bRegex)) } // for (DWORD i=0; i