OSDN Git Service

Add "Rebase" menu at log list. "Cherry Pick show " at multi selection
authorFrank Li <lznuaa@gmail.com>
Sat, 21 Feb 2009 08:14:04 +0000 (16:14 +0800)
committerFrank Li <lznuaa@gmail.com>
Sat, 21 Feb 2009 08:14:04 +0000 (16:14 +0800)
Signed-off-by: Frank Li <lznuaa@gmail.com>
src/TortoiseProc/GitLogListBase.cpp

index b46cc7e..cd5b06f 100644 (file)
@@ -1046,25 +1046,6 @@ void CGitLogListBase::OnContextMenu(CWnd* pWnd, CPoint point)
 \r
                if (GetSelectedCount() == 1)\r
                {\r
-#if 0\r
-                       if (!m_path.IsDirectory())\r
-                       {\r
-                               if (m_hasWC)\r
-                               {\r
-                                       popup.AppendMenuIcon(ID_COMPARE, IDS_LOG_POPUP_COMPARE, IDI_DIFF);\r
-                                       popup.AppendMenuIcon(ID_BLAMECOMPARE, IDS_LOG_POPUP_BLAMECOMPARE, IDI_BLAME);\r
-                               }\r
-                               popup.AppendMenuIcon(ID_GNUDIFF1, IDS_LOG_POPUP_GNUDIFF_CH, IDI_DIFF);\r
-                               popup.AppendMenuIcon(ID_COMPAREWITHPREVIOUS, IDS_LOG_POPUP_COMPAREWITHPREVIOUS, IDI_DIFF);\r
-                               popup.AppendMenu(MF_SEPARATOR, NULL);\r
-                               popup.AppendMenuIcon(ID_SAVEAS, IDS_LOG_POPUP_SAVE, IDI_SAVEAS);\r
-                               popup.AppendMenuIcon(ID_OPEN, IDS_LOG_POPUP_OPEN, IDI_OPEN);\r
-                               popup.AppendMenuIcon(ID_OPENWITH, IDS_LOG_POPUP_OPENWITH, IDI_OPEN);\r
-                               popup.AppendMenuIcon(ID_BLAME, IDS_LOG_POPUP_BLAME, IDI_BLAME);\r
-                               popup.AppendMenu(MF_SEPARATOR, NULL);\r
-                       }\r
-                       else\r
-#endif \r
                        {\r
                                if (m_hasWC)\r
                                {\r
@@ -1122,14 +1103,23 @@ void CGitLogListBase::OnContextMenu(CWnd* pWnd, CPoint point)
 \r
                        if(m_ContextMenuMask&GetContextMenuBit(ID_CREATE_TAG))\r
                                popup.AppendMenuIcon(ID_CREATE_TAG, _T("Create Tag at this version"), IDI_COPY);\r
-\r
+               }\r
+       \r
+               if ( GetSelectedCount() >0 )\r
+               {\r
                        if(m_ContextMenuMask&GetContextMenuBit(ID_CHERRY_PICK))\r
                                popup.AppendMenuIcon(ID_CHERRY_PICK, _T("Cherry Pick this version"), IDI_EXPORT);\r
+       \r
+               }\r
 \r
+               if (GetSelectedCount() == 1)\r
+               {\r
+                       CString str;\r
                        str.Format(_T("Rebase %s to this"),g_Git.GetCurrentBranch());\r
 \r
-                       if(m_ContextMenuMask&GetContextMenuBit(ID_REBASE_TO_VERSION))\r
-                               popup.AppendMenuIcon(ID_REBASE_TO_VERSION, str , IDI_EXPORT);                   \r
+                       if(pSelLogEntry->m_CommitHash != m_HeadHash)\r
+                               if(m_ContextMenuMask&GetContextMenuBit(ID_REBASE_TO_VERSION))\r
+                                       popup.AppendMenuIcon(ID_REBASE_TO_VERSION, str , IDI_EXPORT);                   \r
 \r
                        if(m_ContextMenuMask&GetContextMenuBit(ID_EXPORT))\r
                                popup.AppendMenuIcon(ID_EXPORT, _T("Export this version"), IDI_EXPORT); \r