OSDN Git Service

RebaseDlg: Show Commit List at oldest is first
authorFrank Li <lznuaa@gmail.com>
Sat, 14 Feb 2009 13:44:57 +0000 (21:44 +0800)
committerFrank Li <lznuaa@gmail.com>
Sat, 14 Feb 2009 13:44:57 +0000 (21:44 +0800)
Signed-off-by: Frank Li <lznuaa@gmail.com>
src/TortoiseProc/GitLogListBase.cpp
src/TortoiseProc/GitLogListBase.h
src/TortoiseProc/RebaseDlg.cpp

index 584874f..e37ce97 100644 (file)
@@ -90,6 +90,7 @@ CGitLogListBase::CGitLogListBase():CHintListCtrl()
        m_LoadingThread = NULL;\r
 \r
        m_bExitThread=FALSE;\r
+       m_IsOldFirst = FALSE;\r
 \r
        for(int i=0;i<Lanes::COLORS_NUM;i++)\r
        {\r
@@ -840,7 +841,14 @@ void CGitLogListBase::OnLvnGetdispinfoLoglist(NMHDR *pNMHDR, LRESULT *pResult)
                pLogEntry = reinterpret_cast<GitRev*>(m_arShownList.GetAt(pItem->iItem));\r
 \r
        CString temp;\r
-       temp.Format(_T("%d"),m_arShownList.GetCount()-pItem->iItem);\r
+       if(m_IsOldFirst)\r
+       {\r
+               temp.Format(_T("%d"),pItem->iItem+1);\r
+\r
+       }else\r
+       {\r
+               temp.Format(_T("%d"),m_arShownList.GetCount()-pItem->iItem);\r
+       }\r
            \r
        // Which column?\r
        switch (pItem->iSubItem)\r
@@ -1315,8 +1323,16 @@ int CGitLogListBase::FillGitLog(CTGitPath *path,int info,CString *from,CString *
 \r
        for(unsigned int i=0;i<m_logEntries.size();i++)\r
        {\r
-               m_logEntries[i].m_IsFull=TRUE;\r
-               this->m_arShownList.Add(&m_logEntries[i]);\r
+               if(m_IsOldFirst)\r
+               {\r
+                       m_logEntries[m_logEntries.size()-i-1].m_IsFull=TRUE;\r
+                       this->m_arShownList.Add(&m_logEntries[m_logEntries.size()-i-1]);\r
+               \r
+               }else\r
+               {\r
+                       m_logEntries[i].m_IsFull=TRUE;\r
+                       this->m_arShownList.Add(&m_logEntries[i]);\r
+               }\r
        }\r
 \r
     if(path)\r
@@ -1357,8 +1373,16 @@ int CGitLogListBase::FillGitShortLog()
        this->m_arShownList.RemoveAll();\r
 \r
        for(unsigned int i=0;i<m_logEntries.size();i++)\r
-               this->m_arShownList.Add(&m_logEntries[i]);\r
+       {\r
+               if(this->m_IsOldFirst)\r
+               {\r
+                       this->m_arShownList.Add(&m_logEntries[m_logEntries.size()-1-i]);\r
 \r
+               }else\r
+               {\r
+                       this->m_arShownList.Add(&m_logEntries[i]);\r
+               }\r
+       }\r
        return 0;\r
 }\r
 \r
@@ -1937,7 +1961,13 @@ void CGitLogListBase::RemoveFilter()
 \r
        for (DWORD i=0; i<m_logEntries.size(); ++i)\r
        {\r
-               m_arShownList.Add(&m_logEntries[i]);\r
+               if(this->m_IsOldFirst)\r
+               {\r
+                       m_arShownList.Add(&m_logEntries[m_logEntries.size()-i-1]);\r
+               }else\r
+               {\r
+                       m_arShownList.Add(&m_logEntries[i]);\r
+               }\r
        }\r
 //     InterlockedExchange(&m_bNoDispUpdates, FALSE);\r
        DeleteAllItems();\r
index 42b2359..c3d3e22 100644 (file)
@@ -66,6 +66,9 @@ public:
        virtual ~CGitLogListBase();\r
        volatile LONG           m_bNoDispUpdates;\r
        BOOL m_IsIDReplaceAction;\r
+       BOOL m_IsOldFirst;\r
+       BOOL m_IsRebaseReplaceGraph;\r
+\r
        BOOL m_bStrictStopped;\r
        BOOL m_bShowBugtraqColumn;\r
        BOOL m_bSearchIndex;\r
index 11d3b4a..636c30f 100644 (file)
@@ -114,7 +114,7 @@ BOOL CRebaseDlg::OnInitDialog()
        m_FileListCtrl.Init(SVNSLC_COLEXT | SVNSLC_COLSTATUS , _T("RebaseDlg"));\r
 \r
        m_ctrlTabCtrl.AddTab(&m_FileListCtrl,_T("Conflict File"));\r
-       m_ctrlTabCtrl.AddTab(&m_LogMessageCtrl,_T("Log Message"),1);\r
+       m_ctrlTabCtrl.AddTab(&m_LogMessageCtrl,_T("Commit Message"),1);\r
        AddRebaseAnchor();\r
 \r
 \r
@@ -150,6 +150,9 @@ BOOL CRebaseDlg::OnInitDialog()
                this->m_UpstreamCtrl.EnableWindow(FALSE);\r
        }\r
 \r
+       m_CommitList.m_IsIDReplaceAction = TRUE;\r
+       m_CommitList.m_IsOldFirst = TRUE;\r
+\r
        m_CommitList.DeleteAllItems();\r
        m_CommitList.InsertGitColumn();\r
 \r
@@ -297,7 +300,23 @@ void CRebaseDlg::FetchLogList()
        if( m_CommitList.GetItemCount() == 0 )\r
                m_CommitList.ShowText(_T("Nothing Rebase"));\r
 \r
+       CString hash=g_Git.GetHash(m_UpstreamCtrl.GetString());\r
+       \r
+       if(m_CommitList.m_logEntries[m_CommitList.m_logEntries.size()-1].m_ParentHash.size() >=0 )\r
+       {\r
+               if(hash ==  m_CommitList.m_logEntries[m_CommitList.m_logEntries.size()-1].m_ParentHash[0])\r
+               {\r
+                       m_CommitList.Clear();\r
+                       m_CommitList.ShowText(_T("Nothing Rebase"));\r
+               }\r
+       }\r
+       \r
        m_CommitList.Invalidate();\r
+\r
+       m_tooltips.Pop();\r
+       AddBranchToolTips(&this->m_BranchCtrl);\r
+       AddBranchToolTips(&this->m_UpstreamCtrl);\r
+       \r
 }\r
 \r
 void CRebaseDlg::AddBranchToolTips(CHistoryCombo *pBranch)\r