From 5c7c265b503ce8f7fe3dd7e68a3efe95d520b7bb Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Sun, 1 Jun 2014 12:04:10 +0200 Subject: [PATCH] LogDlg: Propagate selected branch to newly started logs (fixes issue #1706) Signed-off-by: Sven Strickroth --- src/Changelog.txt | 1 + src/Git/GitStatusListCtrl.cpp | 4 ++++ src/Git/GitStatusListCtrl.h | 2 ++ src/TortoiseProc/LogDlg.cpp | 8 ++++++++ 4 files changed, 15 insertions(+) diff --git a/src/Changelog.txt b/src/Changelog.txt index ddbc1f1bf..8bd5fecb8 100644 --- a/src/Changelog.txt +++ b/src/Changelog.txt @@ -13,6 +13,7 @@ Released: Unreleased * Fixed issue #2164: allow Commit from Log > Working dir changes of selected files * Fixed issue #2096: Allow to disable blue text-label about git.exe execution timings on progress dialog * Fixed issue #968: Rebase / Cherry Pick dialogs should update "conflict" status when conflicts are resolved + * Fixed issue #1706: Show log in different branch reverts to active branch == Bug Fixes == * Fixed issue #2158: TortoiseGit sometimes crashes when doing Sync > Pull diff --git a/src/Git/GitStatusListCtrl.cpp b/src/Git/GitStatusListCtrl.cpp index 0541d79bb..5760c7ae9 100644 --- a/src/Git/GitStatusListCtrl.cpp +++ b/src/Git/GitStatusListCtrl.cpp @@ -2064,6 +2064,8 @@ void CGitStatusListCtrl::OnContextMenuList(CWnd * pWnd, CPoint point) sCmd.Format(_T("/command:log /path:\"%s\""), g_Git.m_CurrentDir + _T("\\") + filepath->GetWinPath()); if (cmd == IDGITLC_LOG && filepath->IsDirectory()) sCmd += _T(" /submodule"); + if (!m_sDisplayedBranch.IsEmpty()) + sCmd += _T(" /range:\"") + m_sDisplayedBranch + _T("\""); CAppUtils::RunTortoiseGitProc(sCmd, false, !(cmd == IDGITLC_LOGSUBMODULE)); } break; @@ -2073,6 +2075,8 @@ void CGitStatusListCtrl::OnContextMenuList(CWnd * pWnd, CPoint point) CTGitPath oldName(filepath->GetGitOldPathString()); CString sCmd; sCmd.Format(_T("/command:log /path:\"%s\""), g_Git.m_CurrentDir + _T("\\") + oldName.GetWinPath()); + if (!m_sDisplayedBranch.IsEmpty()) + sCmd += _T(" /range:\"") + m_sDisplayedBranch + _T("\""); CAppUtils::RunTortoiseGitProc(sCmd); } break; diff --git a/src/Git/GitStatusListCtrl.h b/src/Git/GitStatusListCtrl.h index ec7f2ddcb..16a775d81 100644 --- a/src/Git/GitStatusListCtrl.h +++ b/src/Git/GitStatusListCtrl.h @@ -948,6 +948,8 @@ public: CString m_sUUID; ///< the UUID of the associated repository + CString m_sDisplayedBranch; ///< When on LogDialog, what is the current displayed branch + bool m_bIsRevertTheirMy; ///< at rebase case, Their and My version is revert. CWnd *m_hwndLogicalParent; diff --git a/src/TortoiseProc/LogDlg.cpp b/src/TortoiseProc/LogDlg.cpp index 78e53a390..8295a8c50 100644 --- a/src/TortoiseProc/LogDlg.cpp +++ b/src/TortoiseProc/LogDlg.cpp @@ -2562,13 +2562,20 @@ void CLogDlg::OnBnClickedAllBranch() m_LogList.m_ShowMask &=~ (CGit::LOG_INFO_LOCAL_BRANCHES | CGit::LOG_INFO_ALL_BRANCH); if (m_bAllBranch) + { m_bAllBranch = BST_UNCHECKED; + m_ChangedFileListCtrl.m_sDisplayedBranch = m_LogList.GetRange(); + } else { m_bAllBranch = BST_CHECKED; m_LogList.m_ShowMask|=CGit::LOG_INFO_ALL_BRANCH; + m_ChangedFileListCtrl.m_sDisplayedBranch.Empty(); } + // need to save value here, so that log dialogs started from now on also have AllBranch activated + m_regbAllBranch = m_bAllBranch; + UpdateData(FALSE); OnRefresh(); @@ -2700,6 +2707,7 @@ void CLogDlg::ShowStartRef() void CLogDlg::SetRange(const CString& range) { m_LogList.SetRange(range); + m_ChangedFileListCtrl.m_sDisplayedBranch = range; ShowStartRef(); } -- 2.11.4.GIT