From 6d797881fbd2aa34db828481b21cf92e6caedf7a Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Tue, 31 Mar 2015 15:53:49 +0200 Subject: [PATCH] LogDlg: Use same logic for calculating working tree changes as in commit dialog (Fixes issue #1440) (Fixes issue #1501) Signed-off-by: Sven Strickroth --- src/Changelog.txt | 2 ++ src/Resources/TortoiseProcENG.rc | 1 + src/Resources/actionconflicted.ico | Bin 0 -> 1150 bytes src/TortoiseProc/GitLogListBase.cpp | 25 +++++++++++++++---------- src/TortoiseProc/GitLogListBase.h | 1 + src/TortoiseProc/TortoiseProc.vcxproj | 1 + src/TortoiseProc/TortoiseProc.vcxproj.filters | 3 +++ src/TortoiseProc/resource.h | 1 + 8 files changed, 24 insertions(+), 10 deletions(-) create mode 100644 src/Resources/actionconflicted.ico diff --git a/src/Changelog.txt b/src/Changelog.txt index f4758fdd6..c2d947b1e 100644 --- a/src/Changelog.txt +++ b/src/Changelog.txt @@ -22,6 +22,8 @@ Released: Unreleased * Fixed issue #2449: wrong column info in tag reference dialog * In some conditions all files in a versioned folders were displayed as unversioned. * Fixed issue #2374: Rebase option in config not working anymore for pull + * Fixed issue #1440: Different status of modifed renamed or moved files in Show log dialog, Check for Modifications dialog and Commit dialog + * Fixed issue #1501: Unchanged files appears modified in Show Log dialog = Release 1.8.13.0 = Released: 2015-02-15 diff --git a/src/Resources/TortoiseProcENG.rc b/src/Resources/TortoiseProcENG.rc index 2d65787b2..da40b6065 100644 --- a/src/Resources/TortoiseProcENG.rc +++ b/src/Resources/TortoiseProcENG.rc @@ -52,6 +52,7 @@ IDI_ACTIONADDED ICON "actionadded.ico" IDI_ACTIONDELETED ICON "actiondeleted.ico" IDI_ACTIONMODIFIED ICON "actionmodified.ico" IDI_ACTIONREPLACED ICON "actionreplaced.ico" +IDI_ACTIONCONFLICTED ICON "actionconflicted.ico" IDI_SAVEDDATA ICON "saveddata.ico" IDI_GRAPHBAR ICON "graph-bar.ico" IDI_GRAPHBARSTACKED ICON "graph-bar-stacked.ico" diff --git a/src/Resources/actionconflicted.ico b/src/Resources/actionconflicted.ico new file mode 100644 index 0000000000000000000000000000000000000000..0ab33514c62237958cc6013a89a25e9a7fa917c6 GIT binary patch literal 1150 zcwS>*U<5(|0R|vYV8~!$U=RbcG=NwDEW!Yk1(6I44lE4A9Q^-}8xsORHUIHof@WY* zkH+8IoBMx7MJyN-Wd@So->)vf@yg0L!urwJ|K41LIEqoZx<6RWIzCM|_utc*Pj6Xm6zp*g|uYOQCgZ2LWgo{(4@luSi!bvFvh1B1P)Iw`i~70qnA|hA1Q}Cum}2G9*CKNY$*N! O#XpcSI}r0j^Z)>GFkdzR literal 0 HcwPel00001 diff --git a/src/TortoiseProc/GitLogListBase.cpp b/src/TortoiseProc/GitLogListBase.cpp index e0cd757fe..9a0e2ab0b 100644 --- a/src/TortoiseProc/GitLogListBase.cpp +++ b/src/TortoiseProc/GitLogListBase.cpp @@ -86,6 +86,7 @@ CGitLogListBase::CGitLogListBase():CHintListCtrl() m_hModifiedIcon = (HICON)LoadImage(AfxGetResourceHandle(), MAKEINTRESOURCE(IDI_ACTIONMODIFIED), IMAGE_ICON, 0, 0, LR_DEFAULTSIZE); m_hReplacedIcon = (HICON)LoadImage(AfxGetResourceHandle(), MAKEINTRESOURCE(IDI_ACTIONREPLACED), IMAGE_ICON, 0, 0, LR_DEFAULTSIZE); + m_hConflictedIcon = (HICON)LoadImage(AfxGetResourceHandle(), MAKEINTRESOURCE(IDI_ACTIONCONFLICTED), IMAGE_ICON, 0, 0, LR_DEFAULTSIZE); m_hAddedIcon = (HICON)LoadImage(AfxGetResourceHandle(), MAKEINTRESOURCE(IDI_ACTIONADDED), IMAGE_ICON, 0, 0, LR_DEFAULTSIZE); m_hDeletedIcon = (HICON)LoadImage(AfxGetResourceHandle(), MAKEINTRESOURCE(IDI_ACTIONDELETED), IMAGE_ICON, 0, 0, LR_DEFAULTSIZE); m_hFetchIcon = (HICON)LoadImage(AfxGetResourceHandle(), MAKEINTRESOURCE(IDI_ACTIONFETCHING), IMAGE_ICON, 0, 0, LR_DEFAULTSIZE); @@ -180,16 +181,7 @@ int CGitLogListBase::AsyncDiffThread() files.Clear(); pRev->m_ParentHash.clear(); pRev->m_ParentHash.push_back(m_HeadHash); - if(g_Git.IsInitRepos()) - { - if (g_Git.GetInitAddList(files)) - CMessageBox::Show(NULL, _T("Run ls-files failed!"), _T("TortoiseGit"), MB_OK | MB_ICONERROR); - - } - else - { - g_Git.GetCommitDiffList(pRev->m_CommitHash.ToString(), this->m_HeadHash.ToString(), files); - } + g_Git.GetWorkingTreeChanges(files); int& action = pRev->GetAction(this); action = 0; for (int j = 0; j < files.GetCount(); ++j) @@ -268,6 +260,7 @@ CGitLogListBase::~CGitLogListBase() DestroyIcon(m_hModifiedIcon); DestroyIcon(m_hReplacedIcon); + DestroyIcon(m_hConflictedIcon); DestroyIcon(m_hAddedIcon); DestroyIcon(m_hDeletedIcon); m_logEntries.ClearAll(); @@ -1529,6 +1522,11 @@ void CGitLogListBase::OnNMCustomdrawLoglist(NMHDR *pNMHDR, LRESULT *pResult) if (action & CTGitPath::LOGACTIONS_REPLACED) ::DrawIconEx(pLVCD->nmcd.hdc, rect.left+nIcons*iconwidth + ICONITEMBORDER, rect.top, m_hReplacedIcon, iconwidth, iconheight, 0, NULL, DI_NORMAL); ++nIcons; + + if (action & CTGitPath::LOGACTIONS_UNMERGED) + ::DrawIconEx(pLVCD->nmcd.hdc, rect.left + nIcons*iconwidth + ICONITEMBORDER, rect.top, m_hConflictedIcon, iconwidth, iconheight, 0, NULL, DI_NORMAL); + ++nIcons; + *pResult = CDRF_SKIPDEFAULT; return; } @@ -4285,6 +4283,13 @@ CString CGitLogListBase::GetToolTipText(int nItem, int nSubItem) actionText += CTGitPath::GetActionName(CTGitPath::LOGACTIONS_REPLACED); } + if (actions & CTGitPath::LOGACTIONS_UNMERGED) + { + if (!actionText.IsEmpty()) + actionText += L"\r\n"; + actionText += CTGitPath::GetActionName(CTGitPath::LOGACTIONS_UNMERGED); + } + if (!actionText.IsEmpty()) { CString sTitle(MAKEINTRESOURCE(IDS_LOG_ACTIONS)); diff --git a/src/TortoiseProc/GitLogListBase.h b/src/TortoiseProc/GitLogListBase.h index 0a601b1f8..3ea3c77b3 100644 --- a/src/TortoiseProc/GitLogListBase.h +++ b/src/TortoiseProc/GitLogListBase.h @@ -596,6 +596,7 @@ protected: HICON m_hModifiedIcon; HICON m_hReplacedIcon; + HICON m_hConflictedIcon; HICON m_hAddedIcon; HICON m_hDeletedIcon; HICON m_hFetchIcon; diff --git a/src/TortoiseProc/TortoiseProc.vcxproj b/src/TortoiseProc/TortoiseProc.vcxproj index d2d77829d..cf3854a5e 100644 --- a/src/TortoiseProc/TortoiseProc.vcxproj +++ b/src/TortoiseProc/TortoiseProc.vcxproj @@ -562,6 +562,7 @@ + diff --git a/src/TortoiseProc/TortoiseProc.vcxproj.filters b/src/TortoiseProc/TortoiseProc.vcxproj.filters index 60949728a..6d983a4c8 100644 --- a/src/TortoiseProc/TortoiseProc.vcxproj.filters +++ b/src/TortoiseProc/TortoiseProc.vcxproj.filters @@ -2061,6 +2061,9 @@ Resource Files + + Resource Files + diff --git a/src/TortoiseProc/resource.h b/src/TortoiseProc/resource.h index e6e00c29b..33b19c8a8 100644 --- a/src/TortoiseProc/resource.h +++ b/src/TortoiseProc/resource.h @@ -65,6 +65,7 @@ #define IDI_ACTIONDELETED 214 #define IDI_ACTIONMODIFIED 215 #define IDI_ACTIONREPLACED 216 +#define IDI_ACTIONCONFLICTED 217 #define IDI_SAVEDDATA 225 #define IDI_GRAPHBAR 229 #define IDI_GRAPHBARSTACKED 230 -- 2.11.4.GIT