OSDN Git Service

Add Show "No Merge" and "First Parent Only" Option at Show ALL menu button
authorFrank Li <lznuaa@gmail.com>
Fri, 30 Jan 2009 06:54:47 +0000 (14:54 +0800)
committerFrank Li <lznuaa@gmail.com>
Fri, 30 Jan 2009 06:54:47 +0000 (14:54 +0800)
Signed-off-by: Frank Li <lznuaa@gmail.com>
src/Git/Git.cpp
src/Git/Git.h
src/Resources/TortoiseProcENG.rc
src/TortoiseProc/GitLogListBase.cpp
src/TortoiseProc/GitLogListBase.h
src/TortoiseProc/LogDlg.cpp
src/TortoiseProc/resource.h

index 86a3e59..3a49ed0 100644 (file)
@@ -267,6 +267,11 @@ int CGit::GetLog(BYTE_VECTOR& logOut, CString &hash,  CTGitPath *path ,int count
        if(mask& CGit::LOG_INFO_DETECT_RENAME )\r
                param += _T(" -M ");\r
 \r
+       if(mask& CGit::LOG_INFO_FIRST_PARENT )\r
+               param += _T(" --first-parent ");\r
+       \r
+       if(mask& CGit::LOG_INFO_NO_MERGE )\r
+               param += _T(" --no-merges ");\r
        param+=hash;\r
 \r
        cmd.Format(_T("git.exe log %s -z --topo-order --parents %s --pretty=format:\""),\r
index 406bfa9..d254b76 100644 (file)
@@ -49,7 +49,9 @@ public:
         LOG_INFO_ALL_BRANCH=0x20,\r
                LOG_INFO_ONLY_HASH=0x40,\r
                LOG_INFO_DETECT_RENAME=0x80,\r
-               LOG_INFO_DETECT_COPYRENAME=0x100\r
+               LOG_INFO_DETECT_COPYRENAME=0x100,\r
+               LOG_INFO_FIRST_PARENT = 0x200,\r
+               LOG_INFO_NO_MERGE = 0x400,\r
        }LOG_INFO_MASK;\r
 \r
        int GetRemoteList(STRING_VECTOR &list);\r
index e74ca0b..3da30e7 100644 (file)
Binary files a/src/Resources/TortoiseProcENG.rc and b/src/Resources/TortoiseProcENG.rc differ
index 63bf3eb..e289dc5 100644 (file)
@@ -86,7 +86,7 @@ CGitLogListBase::CGitLogListBase():CHintListCtrl()
 \r
        m_From=CTime(1970,1,2,0,0,0);\r
        m_To=CTime::GetCurrentTime();\r
-    m_bAllBranch = FALSE;\r
+    m_ShowMask = 0;\r
        m_LoadingThread = NULL;\r
 \r
        m_bExitThread=FALSE;\r
@@ -1326,8 +1326,8 @@ int CGitLogListBase::FillGitShortLog()
        CString hash;\r
        int mask;\r
        mask = CGit::LOG_INFO_ONLY_HASH | CGit::LOG_INFO_BOUNDARY;\r
-       if(this->m_bAllBranch)\r
-               mask |= CGit::LOG_INFO_ALL_BRANCH;\r
+//     if(this->m_bAllBranch)\r
+       mask |= m_ShowMask;\r
 \r
        this->m_logEntries.ParserShortLog(path,hash,-1,mask);\r
        \r
index c37f92b..161f20b 100644 (file)
@@ -154,7 +154,7 @@ public:
        CTime                   m_To;\r
     \r
     CTGitPath           m_Path;\r
-    BOOL           m_bAllBranch;\r
+    int                                        m_ShowMask;\r
 \r
        void                            GetTimeRange(CTime &oldest,CTime &latest);\r
        virtual void ContextMenuAction(int cmd,int FirstSelect, int LastSelect)=0;\r
index 36fa972..78d6677 100644 (file)
@@ -338,6 +338,10 @@ BOOL CLogDlg::OnInitDialog()
        format.LoadString(IDS_LOG_SHOW_CURRENT_BRANCH);\r
        temp.Format(format,g_Git.GetCurrentBranch());\r
        m_btnShow.AddEntry(temp);\r
+       temp.LoadString(IDS_LOG_SHOW_FIRST_PARENT);\r
+       m_btnShow.AddEntry(temp);\r
+       temp.LoadString(IDS_LOG_SHOW_NO_MERGE);\r
+       m_btnShow.AddEntry(temp);\r
        m_btnShow.SetCurrentEntry((LONG)CRegDWORD(_T("Software\\TortoiseGit\\ShowAllEntry")));\r
 \r
        temp.LoadString(IDS_LOG_SHOW_WHOLE);\r
@@ -410,12 +414,13 @@ LRESULT CLogDlg::OnLogListLoading(WPARAM wParam, LPARAM lParam)
                DialogEnableWindow(IDC_REFRESH, TRUE);\r
 \r
 //             PostMessage(WM_TIMER, LOGFILTER_TIMER);\r
-\r
+               GetDlgItem(IDC_PROGRESS)->ShowWindow(FALSE);\r
                //CTime time=m_LogList.GetOldestTime();\r
                CTime begin,end;\r
                m_LogList.GetTimeRange(begin,end);\r
                m_DateFrom.SetTime(&begin);\r
                m_DateTo.SetTime(&end);\r
+\r
        \r
        }else\r
        {\r
@@ -640,11 +645,16 @@ void CLogDlg::GetAll(bool bIsShowProjectOrBranch)
                switch (entry)\r
                {\r
                        case 0: // show all branch\r
-                               m_LogList.m_bAllBranch=true;\r
+                               m_LogList.m_ShowMask=CGit::LOG_INFO_ALL_BRANCH;\r
                                break;\r
                        case 1: // show current branch\r
-                               m_LogList.m_bAllBranch=false;\r
-                               \r
+                               m_LogList.m_ShowMask=0;\r
+                               break;\r
+                       case 2: // first parent\r
+                               m_LogList.m_ShowMask=CGit::LOG_INFO_FIRST_PARENT;\r
+                               break;\r
+                       case 3: // no merge\r
+                               m_LogList.m_ShowMask=CGit::LOG_INFO_NO_MERGE;\r
                                break;\r
                }\r
        }\r
index 7ef0435..cf2186c 100644 (file)
Binary files a/src/TortoiseProc/resource.h and b/src/TortoiseProc/resource.h differ