OSDN Git Service

Add Combine Commit to one commit at log list dialog
[tortoisegit/TortoiseGitJp.git] / src / TortoiseProc / GitLogListBase.cpp
index 3bc63a3..da2078b 100644 (file)
@@ -1133,6 +1133,7 @@ void CGitLogListBase::OnContextMenu(CWnd* pWnd, CPoint point)
                                if(m_ContextMenuMask&GetContextMenuBit(ID_COMPARETWO))\r
                                        popup.AppendMenuIcon(ID_COMPARETWO, IDS_LOG_POPUP_COMPARETWO, IDI_DIFF);\r
                        }\r
+\r
                        if (GetSelectedCount() == 2)\r
                        {\r
                                //popup.AppendMenuIcon(ID_BLAMETWO, IDS_LOG_POPUP_BLAMEREVS, IDI_BLAME);\r
@@ -1140,6 +1141,20 @@ void CGitLogListBase::OnContextMenu(CWnd* pWnd, CPoint point)
                                        popup.AppendMenuIcon(ID_GNUDIFF2, IDS_LOG_POPUP_GNUDIFF, IDI_DIFF);\r
                                bAddSeparator = true;\r
                        }\r
+\r
+                       if ( IsSelectionContinuous() )\r
+                       {\r
+                               if(m_ContextMenuMask&GetContextMenuBit(ID_COMBINE_COMMIT))\r
+                               {\r
+                                       CString head;\r
+                                       head.Format(_T("HEAD~%d"),LastSelect);\r
+                                       CString hash=g_Git.GetHash(head);\r
+                                       hash=hash.Left(40);\r
+                                       GitRev* pLastEntry = reinterpret_cast<GitRev*>(m_arShownList.GetAt(LastSelect));\r
+                                       if(pLastEntry->m_CommitHash == hash)\r
+                                               popup.AppendMenuIcon(ID_COMBINE_COMMIT,_T("Combine to one commit"),IDI_MERGE);\r
+                               }\r
+                       }\r
                        if (m_hasWC)\r
                        {\r
                                //popup.AppendMenuIcon(ID_REVERTREV, IDS_LOG_POPUP_REVERTREVS, IDI_REVERT);\r