From 9fcc1c9a887ba068d44967bf604d293613d1a2df Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Tue, 24 Dec 2013 16:59:43 +0100 Subject: [PATCH] Fixed issue #1129: Add Fetch/Pull operations in Show Log window Signed-off-by: Sven Strickroth --- src/Changelog.txt | 1 + src/TortoiseProc/AppUtils.cpp | 8 +++++--- src/TortoiseProc/GitLogListAction.cpp | 6 ++++++ src/TortoiseProc/GitLogListBase.cpp | 9 +++++++++ src/TortoiseProc/GitLogListBase.h | 1 + 5 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/Changelog.txt b/src/Changelog.txt index 417d51785..0970455cc 100644 --- a/src/Changelog.txt +++ b/src/Changelog.txt @@ -22,6 +22,7 @@ Released: Unreleased * Fixed issue #1847: Option to show all local branches in log view * Fixed issue #1823: Pressing tab key can insert spaces instead of tab in TortoiseGitMerge * Fixed issue #2047: Create a log file with git commands and output + * Fixed issue #1129: Add Fetch/Pull operations in Show Log window == Bug Fixes == * Fixed issue #1947: When editing git notes, spurious reformatting is done diff --git a/src/TortoiseProc/AppUtils.cpp b/src/TortoiseProc/AppUtils.cpp index 41931e79c..be7db9032 100644 --- a/src/TortoiseProc/AppUtils.cpp +++ b/src/TortoiseProc/AppUtils.cpp @@ -2272,7 +2272,7 @@ bool CAppUtils::Pull(bool showPush, bool autoClose) dlg.m_pathList.AddPath(CTGitPath()); dlg.DoModal(); - return FALSE; + return true; } CGitHash hashNew; @@ -2295,7 +2295,7 @@ bool CAppUtils::Pull(bool showPush, bool autoClose) dlg.SetDiff(NULL, hashNew.ToString(), hashOld.ToString()); dlg.DoModal(); - return TRUE; + return true; } else if ( ret == IDC_PROGRESS_BUTTON1 +1 ) { @@ -2313,6 +2313,7 @@ bool CAppUtils::Pull(bool showPush, bool autoClose) else if (ret == pushButton) { Push(_T(""), autoClose); + return true; } else if (ret == smUpdateButton) { @@ -2320,10 +2321,11 @@ bool CAppUtils::Pull(bool showPush, bool autoClose) sCmd.Format(_T("/command:subupdate /bkpath:\"%s\""), g_Git.m_CurrentDir); CAppUtils::RunTortoiseGitProc(sCmd); + return true; } } - return false; + return true; } bool CAppUtils::Fetch(CString remoteName, bool allowRebase, bool autoClose) diff --git a/src/TortoiseProc/GitLogListAction.cpp b/src/TortoiseProc/GitLogListAction.cpp index 746932d7f..4df383b0b 100644 --- a/src/TortoiseProc/GitLogListAction.cpp +++ b/src/TortoiseProc/GitLogListAction.cpp @@ -847,6 +847,12 @@ void CGitLogList::ContextMenuAction(int cmd,int FirstSelect, int LastSelect, CMe Refresh(); } break; + case ID_PULL: + { + if (CAppUtils::Pull()) + Refresh(); + } + break; case ID_FETCH: { if (CAppUtils::Fetch(_T(""), true)) diff --git a/src/TortoiseProc/GitLogListBase.cpp b/src/TortoiseProc/GitLogListBase.cpp index bb550e99e..38d571f8a 100644 --- a/src/TortoiseProc/GitLogListBase.cpp +++ b/src/TortoiseProc/GitLogListBase.cpp @@ -1870,6 +1870,9 @@ void CGitLogListBase::OnContextMenu(CWnd* pWnd, CPoint point) if (pSelLogEntry->m_CommitHash.IsEmpty()) { + if (m_ContextMenuMask & GetContextMenuBit(ID_PULL) && !isMergeActive) + popup.AppendMenuIcon(ID_PULL, IDS_MENUPULL, IDI_PULL); + if(m_ContextMenuMask&GetContextMenuBit(ID_FETCH)) popup.AppendMenuIcon(ID_FETCH, IDS_MENUFETCH, IDI_PULL); @@ -2122,6 +2125,12 @@ void CGitLogListBase::OnContextMenu(CWnd* pWnd, CPoint point) bAddSeparator = true; } } + if (m_ContextMenuMask & GetContextMenuBit(ID_PULL) && isHeadCommit && !isMergeActive) + { + popup.AppendMenuIcon(ID_PULL, IDS_MENUPULL, IDI_PULL); + bAddSeparator = true; + } + if(m_ContextMenuMask &GetContextMenuBit(ID_DELETE)) { diff --git a/src/TortoiseProc/GitLogListBase.h b/src/TortoiseProc/GitLogListBase.h index eb22278a7..cd5538d5f 100644 --- a/src/TortoiseProc/GitLogListBase.h +++ b/src/TortoiseProc/GitLogListBase.h @@ -276,6 +276,7 @@ public: ID_DELETE, ID_COMMIT, ID_PUSH, + ID_PULL, ID_FETCH, ID_SHOWBRANCHES, ID_COPYCLIPBOARDMESSAGES, -- 2.11.4.GIT