OSDN Git Service

Log Dld Message and File List Work
authorFrank Li <lznuaa@gmail.com>
Sat, 22 Nov 2008 05:34:43 +0000 (13:34 +0800)
committerFrank Li <lznuaa@gmail.com>
Sat, 22 Nov 2008 05:34:43 +0000 (13:34 +0800)
12 files changed:
Git/Git.cpp
Git/GitRev.cpp
Git/GitRev.h
Git/TGitPath.cpp
Git/TGitPath.h
Resources/TortoiseProcENG.rc
TortoiseProc/ILogReceiver.h
TortoiseProc/LogDlg.cpp
TortoiseProc/LogDlg.h
TortoiseProc/TortoiseProc.vcproj.FSL.B20596.user
TortoiseProc/resource.h
TortoiseShell/TortoiseShell.suo

index 20ed425..765a8a4 100644 (file)
@@ -100,7 +100,7 @@ int CGit::GetLog(CString& logOut)
 \r
        CString cmd;\r
        CString log;\r
-       cmd=("git.cmd log -C --numstat --pretty=format:\"");\r
+       cmd=("git.cmd log -C --numstat --raw --pretty=format:\"");\r
        log.Format(_T("#<%c>%%n"),LOG_REV_ITEM_BEGIN);\r
        cmd += log;\r
        log.Format(_T("#<%c>%%an%%n"),LOG_REV_AUTHOR_NAME);\r
index edcd0ae..70e9a8d 100644 (file)
@@ -4,6 +4,7 @@
 \r
 GitRev::GitRev(void)\r
 {\r
+       m_Action=0;\r
 }\r
 \r
 GitRev::~GitRev(void)\r
@@ -28,6 +29,7 @@ int GitRev::ParserFromLog(CString &log)
        TCHAR mode;\r
        CTGitPath  path;\r
        this->m_Files.Clear();\r
+    m_Action=0;\r
 \r
        while( pos>=0 )\r
        {\r
@@ -60,7 +62,7 @@ int GitRev::ParserFromLog(CString &log)
                                this->m_Subject = text;\r
                                break;\r
                        case LOG_REV_COMMIT_BODY:\r
-                               this->m_Body = text;\r
+                               this->m_Body = text +_T("\n");\r
                                break;\r
                        case LOG_REV_COMMIT_HASH:\r
                                this->m_CommitHash = text;\r
@@ -76,25 +78,66 @@ int GitRev::ParserFromLog(CString &log)
                        switch(mode)\r
                        {\r
                        case LOG_REV_COMMIT_BODY:\r
-                               this->m_Subject += one;\r
+                               this->m_Body += one+_T("\n");\r
                                break;\r
                        case LOG_REV_COMMIT_FILE:\r
                                if(one[0]==_T(':'))\r
                                {\r
+                                       int tabstart=0;\r
+                                       int actionstart=0;\r
+                                       CString pathname;\r
+                                       CString action;\r
+                                       one.Tokenize(_T("\t"),tabstart);\r
+                                       if(tabstart >0)\r
+                                       {\r
+                                               action=one.Left(tabstart);\r
+                                               actionstart=action.ReverseFind(_T(' '));\r
+                                               if(actionstart>0)\r
+                                               {\r
+                                                       action=action.Right(action.GetLength()-actionstart);\r
+                                               }\r
+                                               pathname=one.Right(one.GetLength()-tabstart);\r
+                                               \r
+                                               CTGitPath *GitPath=m_Files.LookForGitPath(pathname);\r
+                                               \r
+                                               if(GitPath)\r
+                                               {\r
+                                                       this->m_Action|=GitPath->ParserAction(action);  \r
+                                                       \r
+                                               }else\r
+                                               {       \r
+                                                       path.SetFromGit(pathname);\r
+                                                       //action must be set after setfromgit. SetFromGit will clear all status. \r
+                                                       this->m_Action|=path.ParserAction(action);\r
+                                                       this->m_Files.AddPath(path);\r
+                                               }\r
+                                       }\r
                                        \r
                                }else\r
                                {\r
                                        int tabstart=0;\r
-                                       \r
-                                       path.m_StatAdd=_wtoi(one.Tokenize(_T("\t"),tabstart));\r
+                                       path.Reset();\r
+                                       CString StatAdd=(one.Tokenize(_T("\t"),tabstart));\r
                                        if( tabstart< 0)\r
                                                break;\r
-//                                     tabstart+=1;\r
-                                       path.m_StatDel=_wtoi(one.Tokenize(_T("\t"),tabstart));\r
-//                                     tabstart++;\r
+                                       CString StatDel=(one.Tokenize(_T("\t"),tabstart));\r
+\r
+                                       //SetFromGit will reset all context of GitRev\r
                                        path.SetFromGit(one.Right(one.GetLength()-tabstart));\r
                                \r
-                                       this->m_Files.AddPath(path);\r
+                                       CTGitPath *GitPath=m_Files.LookForGitPath(path.GetGitPathString());\r
+                                       if(GitPath)\r
+                                       {\r
+                                               GitPath->m_StatAdd=StatAdd;\r
+                                               GitPath->m_StatDel=StatDel;\r
+\r
+                                       }else\r
+                                       {\r
+                                               //path.SetFromGit(pathname);\r
+                                               path.m_StatAdd=StatAdd;\r
+                                               path.m_StatDel=StatDel;\r
+                                               this->m_Files.AddPath(path);\r
+                                       }\r
                                }\r
                                break;\r
                        }\r
index 6bd54c8..53b95c3 100644 (file)
@@ -19,6 +19,7 @@ typedef std::vector<git_revnum_t> GIT_REV_LIST;
 #define LOG_REV_ITEM_END               _T('C')\r
 \r
 \r
+\r
 class GitRev\r
 {\r
 public:\r
@@ -45,7 +46,7 @@ public:
        git_revnum_t m_CommitHash;\r
        GIT_REV_LIST m_ParentHash;\r
        CTGitPathList m_Files;\r
-\r
+       int     m_Action;\r
        int ParserFromLog(CString &log);\r
        CTime ConverFromString(CString input);\r
 };\r
index fa469f2..185c581 100644 (file)
@@ -50,6 +50,7 @@ CTGitPath::CTGitPath(void) :
        m_bIsSpecialDirectoryKnown(false),\r
        m_bIsSpecialDirectory(false)\r
 {\r
+       m_Action=0;\r
 }\r
 \r
 CTGitPath::~CTGitPath(void)\r
@@ -76,8 +77,24 @@ CTGitPath::CTGitPath(const CString& sUnknownPath) :
        m_bIsSpecialDirectory(false)\r
 {\r
        SetFromUnknown(sUnknownPath);\r
+       m_Action=0;\r
 }\r
 \r
+int CTGitPath::ParserAction(CString action)\r
+{\r
+       action=action.TrimLeft();\r
+       TCHAR c=action.GetAt(0);\r
+       if(c == _T('M'))\r
+               m_Action|= LOGACTIONS_MODIFIED;\r
+       if(c == _T('R'))\r
+               m_Action|= LOGACTIONS_REPLACED;\r
+       if(c == _T('A'))\r
+               m_Action|= LOGACTIONS_ADDED;\r
+       if(c == _T('D'))\r
+               m_Action|= LOGACTIONS_DELETED;\r
+\r
+       return m_Action;\r
+}\r
 void CTGitPath::SetFromGit(const char* pPath)\r
 {\r
        Reset();\r
@@ -411,6 +428,9 @@ void CTGitPath::Reset()
        m_sBackslashPath.Empty();\r
        m_sFwdslashPath.Empty();\r
        m_sUTF8FwdslashPath.Empty();\r
+       this->m_Action=0;\r
+       this->m_StatAdd=_T("");\r
+       this->m_StatDel=_T("");\r
        ATLASSERT(IsEmpty());\r
 }\r
 \r
@@ -1544,3 +1564,26 @@ private:
 #endif\r
 #endif\r
 \r
+CTGitPath * CTGitPathList::LookForGitPath(CString path)\r
+{\r
+       int i=0;\r
+       for(i=0;i<this->GetCount();i++)\r
+       {\r
+               if((*this)[i].GetGitPathString() == path )\r
+                       return (CTGitPath*)&(*this)[i];\r
+       }\r
+       return NULL;\r
+}\r
+\r
+CString CTGitPath::GetActionName()\r
+{\r
+       if(m_Action  & CTGitPath::LOGACTIONS_ADDED)\r
+               return _T("Added");\r
+       if(m_Action  & CTGitPath::LOGACTIONS_DELETED)\r
+               return _T("Deleted");\r
+       if(m_Action  & CTGitPath::LOGACTIONS_MODIFIED)\r
+               return _T("Modified");\r
+       if(m_Action  & CTGitPath::LOGACTIONS_REPLACED)\r
+               return _T("Rename");\r
+       return _T("Unknown");\r
+}
\ No newline at end of file
index ba8014c..c9cad65 100644 (file)
@@ -1,5 +1,6 @@
 #pragma once\r
 \r
+\r
 class CTGitPath\r
 {\r
 public:\r
@@ -7,9 +8,19 @@ public:
        ~CTGitPath(void);\r
  CTGitPath(const CString& sUnknownPath);\r
 public:\r
-       int m_StatAdd;\r
-       int m_StatDel;\r
+       enum\r
+       {       \r
+               LOGACTIONS_ADDED        = 0x00000001,\r
+               LOGACTIONS_MODIFIED     = 0x00000002,\r
+               LOGACTIONS_REPLACED     = 0x00000004,\r
+               LOGACTIONS_DELETED      = 0x00000008\r
+       };\r
 \r
+       CString m_StatAdd;\r
+       CString m_StatDel;\r
+       int             m_Action;\r
+       int     ParserAction(CString action);\r
+       CString GetActionName();\r
        /**\r
         * Set the path as an UTF8 string with forward slashes\r
         */\r
@@ -276,6 +287,7 @@ public:
        void AddPath(const CTGitPath& newPath);\r
        bool LoadFromFile(const CTGitPath& filename);\r
        bool WriteToFile(const CString& sFilename, bool bANSI = false) const;\r
+       CTGitPath * LookForGitPath(CString path);\r
 \r
        /**\r
         * Load from the path argument string, when the 'path' parameter is used\r
index 3bb0357..cf3749d 100644 (file)
Binary files a/Resources/TortoiseProcENG.rc and b/Resources/TortoiseProcENG.rc differ
index 362a0de..2931789 100644 (file)
@@ -52,13 +52,7 @@ private:
        mutable CString actionAsString;\r
 };\r
 \r
-enum\r
-{\r
-       LOGACTIONS_ADDED        = 0x00000001,\r
-       LOGACTIONS_MODIFIED     = 0x00000002,\r
-       LOGACTIONS_REPLACED     = 0x00000004,\r
-       LOGACTIONS_DELETED      = 0x00000008\r
-};\r
+\r
 \r
 /// auto-deleting extension of MFC Arrays for pointer arrays\r
 \r
index 7906359..b5678c3 100644 (file)
@@ -302,35 +302,45 @@ BOOL CLogDlg::OnInitDialog()
        // set up the columns\r
        m_LogList.DeleteAllItems();\r
        int c = ((CHeaderCtrl*)(m_LogList.GetDlgItem(0)))->GetItemCount()-1;\r
+       \r
        while (c>=0)\r
                m_LogList.DeleteColumn(c--);\r
-       temp.LoadString(IDS_LOG_REVISION);\r
-       m_LogList.InsertColumn(0, temp);\r
+       temp.LoadString(IDS_LOG_GRAPH);\r
+\r
+       m_LogList.InsertColumn(this->LOGLIST_GRAPH, temp);\r
        \r
+#if 0  \r
        // make the revision column right aligned\r
        LVCOLUMN Column;\r
        Column.mask = LVCF_FMT;\r
        Column.fmt = LVCFMT_RIGHT;\r
        m_LogList.SetColumn(0, &Column); \r
-       \r
+#endif \r
 //     CString log;\r
 //     g_Git.GetLog(log);\r
 \r
        temp.LoadString(IDS_LOG_ACTIONS);\r
-       m_LogList.InsertColumn(1, temp);\r
+       m_LogList.InsertColumn(this->LOGLIST_ACTION, temp);\r
+       \r
+       temp.LoadString(IDS_LOG_MESSAGE);\r
+       m_LogList.InsertColumn(this->LOGLIST_MESSAGE, temp);\r
+       \r
        temp.LoadString(IDS_LOG_AUTHOR);\r
-       m_LogList.InsertColumn(2, temp);\r
+       m_LogList.InsertColumn(this->LOGLIST_AUTHOR, temp);\r
+       \r
        temp.LoadString(IDS_LOG_DATE);\r
-       m_LogList.InsertColumn(3, temp);\r
+       m_LogList.InsertColumn(this->LOGLIST_DATE, temp);\r
+       \r
+\r
        if (m_bShowBugtraqColumn)\r
        {\r
                temp = m_ProjectProperties.sLabel;\r
                if (temp.IsEmpty())\r
                        temp.LoadString(IDS_LOG_BUGIDS);\r
-               m_LogList.InsertColumn(4, temp);\r
+               m_LogList.InsertColumn(this->LOGLIST_BUG, temp);\r
+\r
        }\r
-       temp.LoadString(IDS_LOG_MESSAGE);\r
-       m_LogList.InsertColumn(m_bShowBugtraqColumn ? 5 : 4, temp);\r
+       \r
        m_LogList.SetRedraw(false);\r
        ResizeAllListCtrlCols();\r
        m_LogList.SetRedraw(true);\r
@@ -341,13 +351,14 @@ BOOL CLogDlg::OnInitDialog()
        while (c>=0)\r
                m_ChangedFileListCtrl.DeleteColumn(c--);\r
        temp.LoadString(IDS_PROGRS_ACTION);\r
-       m_ChangedFileListCtrl.InsertColumn(0, temp);\r
+       m_ChangedFileListCtrl.InsertColumn(this->FILELIST_ACTION, temp);\r
+       temp.LoadString(IDS_LOG_FILE_LINE_ADD);\r
+       m_ChangedFileListCtrl.InsertColumn(this->FILELIST_ADD, temp);\r
+       temp.LoadString(IDS_LOG_FILE_LINE_DEL);\r
+       m_ChangedFileListCtrl.InsertColumn(this->FILELIST_DEL, temp);\r
        temp.LoadString(IDS_PROGRS_PATH);\r
-       m_ChangedFileListCtrl.InsertColumn(1, temp);\r
-       temp.LoadString(IDS_LOG_COPYFROM);\r
-       m_ChangedFileListCtrl.InsertColumn(2, temp);\r
-       temp.LoadString(IDS_LOG_REVISION);\r
-       m_ChangedFileListCtrl.InsertColumn(3, temp);\r
+       m_ChangedFileListCtrl.InsertColumn(this->FILELIST_PATH, temp);\r
+       \r
        m_ChangedFileListCtrl.SetRedraw(false);\r
        CAppUtils::ResizeAllListCtrlCols(&m_ChangedFileListCtrl);\r
        m_ChangedFileListCtrl.SetRedraw(true);\r
@@ -552,7 +563,7 @@ void CLogDlg::FillLogMessageCtrl(bool bShow /* = true*/)
        // we fill here the log message rich edit control,\r
        // and also populate the changed files list control\r
        // according to the selected revision(s).\r
-#if 0\r
+\r
        CWnd * pMsgView = GetDlgItem(IDC_MSGVIEW);\r
        // empty the log message view\r
        pMsgView->SetWindowText(_T(" "));\r
@@ -599,21 +610,22 @@ void CLogDlg::FillLogMessageCtrl(bool bShow /* = true*/)
                        m_ChangedFileListCtrl.SetRedraw(TRUE);\r
                        return;\r
                }\r
-               PLOGENTRYDATA pLogEntry = reinterpret_cast<PLOGENTRYDATA>(m_arShownList.GetAt(selIndex));\r
+               GitRev* pLogEntry = reinterpret_cast<GitRev *>(m_arShownList.GetAt(selIndex));\r
 \r
                // set the log message text\r
-               pMsgView->SetWindowText(pLogEntry->sMessage);\r
+               pMsgView->SetWindowText(_T("*")+pLogEntry->m_Subject+_T("\n\n")+pLogEntry->m_Body);\r
                // turn bug ID's into links if the bugtraq: properties have been set\r
                // and we can find a match of those in the log message\r
-               m_ProjectProperties.FindBugID(pLogEntry->sMessage, pMsgView);\r
+               m_ProjectProperties.FindBugID(pLogEntry->m_Body, pMsgView);\r
                CAppUtils::FormatTextInRichEditControl(pMsgView);\r
-               m_currentChangedArray = pLogEntry->pArChangedPaths;\r
+               m_currentChangedArray = &(pLogEntry->m_Files);\r
                if (m_currentChangedArray == NULL)\r
                {\r
                        InterlockedExchange(&m_bNoDispUpdates, FALSE);\r
                        m_ChangedFileListCtrl.SetRedraw(TRUE);\r
                        return;\r
                }\r
+#if 0\r
                // fill in the changed files list control\r
                if ((m_cHidePaths.GetState() & 0x0003)==BST_CHECKED)\r
                {\r
@@ -630,6 +642,7 @@ void CLogDlg::FillLogMessageCtrl(bool bShow /* = true*/)
                        }\r
                        m_currentChangedArray = &m_CurrentFilteredChangedArray;\r
                }\r
+#endif\r
        }\r
        else\r
        {\r
@@ -664,7 +677,7 @@ void CLogDlg::FillLogMessageCtrl(bool bShow /* = true*/)
        else\r
                SetSortArrow(&m_ChangedFileListCtrl, -1, false);\r
        m_ChangedFileListCtrl.SetRedraw(TRUE);\r
-#endif\r
+\r
 }\r
 \r
 void CLogDlg::OnBnClickedGetall()\r
@@ -1232,9 +1245,11 @@ UINT CLogDlg::LogThread()
        this->m_logEntries.ClearAll();\r
        this->m_logEntries.ParserFromLog();\r
        m_LogList.SetItemCountEx(this->m_logEntries.size());\r
-       \r
-       this->m_arShownList.Add(&g_rev);\r
-       g_rev.m_AuthorName.Append(_T("Frank Li"));\r
+\r
+       this->m_arShownList.RemoveAll();\r
+\r
+       for(int i=0;i<m_logEntries.size();i++)\r
+               this->m_arShownList.Add(&m_logEntries[i]);\r
        \r
 #if 0  \r
        if (!m_bShowedAll)\r
@@ -2567,24 +2582,23 @@ void CLogDlg::OnNMCustomdrawLoglist(NMHDR *pNMHDR, LRESULT *pResult)
                                        ::FillRect(pLVCD->nmcd.hdc, &rect, brush);\r
                                        ::DeleteObject(brush);\r
                                }\r
-#if 0\r
+\r
                                // Draw the icon(s) into the compatible DC\r
-                               if (pLogEntry->actions & LOGACTIONS_MODIFIED)\r
+                               if (pLogEntry->m_Action & CTGitPath::LOGACTIONS_MODIFIED)\r
                                        ::DrawIconEx(pLVCD->nmcd.hdc, rect.left + ICONITEMBORDER, rect.top, m_hModifiedIcon, iconwidth, iconheight, 0, NULL, DI_NORMAL);\r
                                nIcons++;\r
 \r
-                               if (pLogEntry->actions & LOGACTIONS_ADDED)\r
+                               if (pLogEntry->m_Action & CTGitPath::LOGACTIONS_ADDED)\r
                                        ::DrawIconEx(pLVCD->nmcd.hdc, rect.left+nIcons*iconwidth + ICONITEMBORDER, rect.top, m_hAddedIcon, iconwidth, iconheight, 0, NULL, DI_NORMAL);\r
                                nIcons++;\r
 \r
-                               if (pLogEntry->actions & LOGACTIONS_DELETED)\r
+                               if (pLogEntry->m_Action & CTGitPath::LOGACTIONS_DELETED)\r
                                        ::DrawIconEx(pLVCD->nmcd.hdc, rect.left+nIcons*iconwidth + ICONITEMBORDER, rect.top, m_hDeletedIcon, iconwidth, iconheight, 0, NULL, DI_NORMAL);\r
                                nIcons++;\r
 \r
-                               if (pLogEntry->actions & LOGACTIONS_REPLACED)\r
+                               if (pLogEntry->m_Action & CTGitPath::LOGACTIONS_REPLACED)\r
                                        ::DrawIconEx(pLVCD->nmcd.hdc, rect.left+nIcons*iconwidth + ICONITEMBORDER, rect.top, m_hReplacedIcon, iconwidth, iconheight, 0, NULL, DI_NORMAL);\r
                                nIcons++;\r
-#endif\r
                                *pResult = CDRF_SKIPDEFAULT;\r
                                return;\r
                        }\r
@@ -2596,7 +2610,7 @@ void CLogDlg::OnNMCustomdrawLoglist(NMHDR *pNMHDR, LRESULT *pResult)
 }\r
 void CLogDlg::OnNMCustomdrawChangedFileList(NMHDR *pNMHDR, LRESULT *pResult)\r
 {\r
-#if 0\r
+\r
        NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>( pNMHDR );\r
        // Take the default processing unless we set this to something else below.\r
        *pResult = CDRF_DODEFAULT;\r
@@ -2622,11 +2636,12 @@ void CLogDlg::OnNMCustomdrawChangedFileList(NMHDR *pNMHDR, LRESULT *pResult)
 \r
                COLORREF crText = GetSysColor(COLOR_WINDOWTEXT);\r
                bool bGrayed = false;\r
+#if 0\r
                if ((m_cHidePaths.GetState() & 0x0003)==BST_INDETERMINATE)\r
                {\r
                        if ((m_currentChangedArray)&&((m_currentChangedArray->GetCount() > (INT_PTR)pLVCD->nmcd.dwItemSpec)))\r
                        {\r
-                               if (m_currentChangedArray->GetAt(pLVCD->nmcd.dwItemSpec)->sPath.Left(m_sRelativeRoot.GetLength()).Compare(m_sRelativeRoot)!=0)\r
+                               //if ((*m_currentChangedArray)[(pLVCD->nmcd.dwItemSpec)]sPath.Left(m_sRelativeRoot.GetLength()).Compare(m_sRelativeRoot)!=0)\r
                                {\r
                                        crText = GetSysColor(COLOR_GRAYTEXT);\r
                                        bGrayed = true;\r
@@ -2634,7 +2649,7 @@ void CLogDlg::OnNMCustomdrawChangedFileList(NMHDR *pNMHDR, LRESULT *pResult)
                        }\r
                        else if (m_currentChangedPathList.GetCount() > (INT_PTR)pLVCD->nmcd.dwItemSpec)\r
                        {\r
-                               if (m_currentChangedPathList[pLVCD->nmcd.dwItemSpec].GetGitPathString().Left(m_sRelativeRoot.GetLength()).Compare(m_sRelativeRoot)!=0)\r
+                               //if (m_currentChangedPathList[pLVCD->nmcd.dwItemSpec].GetGitPathString().Left(m_sRelativeRoot.GetLength()).Compare(m_sRelativeRoot)!=0)\r
                                {\r
                                        crText = GetSysColor(COLOR_GRAYTEXT);\r
                                        bGrayed = true;\r
@@ -2642,23 +2657,23 @@ void CLogDlg::OnNMCustomdrawChangedFileList(NMHDR *pNMHDR, LRESULT *pResult)
                        }\r
                }\r
 \r
+#endif\r
                if ((!bGrayed)&&(m_currentChangedArray)&&(m_currentChangedArray->GetCount() > (INT_PTR)pLVCD->nmcd.dwItemSpec))\r
                {\r
-                       DWORD action = m_currentChangedArray->GetAt(pLVCD->nmcd.dwItemSpec)->action;\r
-                       if (action == LOGACTIONS_MODIFIED)\r
+                       DWORD action = ((*m_currentChangedArray)[pLVCD->nmcd.dwItemSpec]).m_Action;\r
+                       if (action == CTGitPath::LOGACTIONS_MODIFIED)\r
                                crText = m_Colors.GetColor(CColors::Modified);\r
-                       if (action == LOGACTIONS_REPLACED)\r
+                       if (action == CTGitPath::LOGACTIONS_REPLACED)\r
                                crText = m_Colors.GetColor(CColors::Deleted);\r
-                       if (action == LOGACTIONS_ADDED)\r
+                       if (action == CTGitPath::LOGACTIONS_ADDED)\r
                                crText = m_Colors.GetColor(CColors::Added);\r
-                       if (action == LOGACTIONS_DELETED)\r
+                       if (action == CTGitPath::LOGACTIONS_DELETED)\r
                                crText = m_Colors.GetColor(CColors::Deleted);\r
                }\r
 \r
                // Store the color back in the NMLVCUSTOMDRAW struct.\r
                pLVCD->clrText = crText;\r
        }\r
-#endif\r
 }\r
 \r
 void CLogDlg::DoSizeV1(int delta)\r
@@ -2910,70 +2925,28 @@ void CLogDlg::OnLvnGetdispinfoLoglist(NMHDR *pNMHDR, LRESULT *pResult)
        // Which column?\r
        switch (pItem->iSubItem)\r
        {\r
-       case 0: //revision\r
+       case this->LOGLIST_GRAPH:       //Graphic\r
                if (pLogEntry)\r
                {\r
-#if 0\r
-                       _stprintf_s(pItem->pszText, pItem->cchTextMax, _T("%ld"), pLogEntry->Rev);\r
-                       // to make the child entries indented, add spaces\r
-                       size_t len = _tcslen(pItem->pszText);\r
-                       TCHAR * pBuf = pItem->pszText + len;\r
-                       DWORD nSpaces = m_maxChild-pLogEntry->childStackDepth;\r
-                       while ((pItem->cchTextMax >= (int)len)&&(nSpaces))\r
-                       {\r
-                               *pBuf = ' ';\r
-                               pBuf++;\r
-                               nSpaces--;\r
-                       }\r
-                       *pBuf = 0;\r
-#endif\r
                }\r
                break;\r
-       case 1: //action -- no text in the column\r
+       case this->LOGLIST_ACTION: //action -- no text in the column\r
+               break;\r
+       case this->LOGLIST_MESSAGE: //Message\r
+               if (pLogEntry)\r
+                       lstrcpyn(pItem->pszText, (LPCTSTR)pLogEntry->m_Subject, pItem->cchTextMax);\r
                break;\r
-       case 2: //author\r
+       case this->LOGLIST_AUTHOR: //Author\r
                if (pLogEntry)\r
                        lstrcpyn(pItem->pszText, (LPCTSTR)pLogEntry->m_AuthorName, pItem->cchTextMax);\r
                break;\r
-       case 3: //date\r
-#if 0\r
+       case this->LOGLIST_DATE: //Date\r
                if (pLogEntry)\r
-                       lstrcpyn(pItem->pszText, (LPCTSTR)pLogEntry->sDate, pItem->cchTextMax);\r
+                       lstrcpyn(pItem->pszText, (LPCTSTR)pLogEntry->m_AuthorDate.Format(_T("%Y-%m-%d %H:%M")), pItem->cchTextMax);\r
                break;\r
-#endif\r
-       case 4: //message or bug id\r
-#if 0\r
-               if (m_bShowBugtraqColumn)\r
-               {\r
-                       if (pLogEntry)\r
-                               lstrcpyn(pItem->pszText, (LPCTSTR)pLogEntry->sBugIDs, pItem->cchTextMax);\r
-                       break;\r
-               }\r
-#endif\r
-               // fall through here!\r
+               \r
        case 5:\r
-#if 0\r
-               if (pLogEntry)\r
-               {\r
-                       // Add as many characters as possible from the short log message\r
-                       // to the list control. If the message is longer than\r
-                       // allowed width, add "..." as an indication.\r
-                       const int dots_len = 3;\r
-                       if (pLogEntry->sShortMessage.GetLength() >= pItem->cchTextMax && pItem->cchTextMax > dots_len)\r
-                       {\r
-                               lstrcpyn(pItem->pszText, (LPCTSTR)pLogEntry->sShortMessage, pItem->cchTextMax - dots_len);\r
-                               lstrcpyn(pItem->pszText + pItem->cchTextMax - dots_len - 1, _T("..."), dots_len + 1);\r
-                       }\r
-                       else\r
-                               lstrcpyn(pItem->pszText, (LPCTSTR)pLogEntry->sShortMessage, pItem->cchTextMax);\r
-               }\r
-               else if ((itemid == m_arShownList.GetCount()) && m_bStrict && m_bStrictStopped)\r
-               {\r
-                       CString sTemp;\r
-                       sTemp.LoadString(IDS_LOG_STOPONCOPY_HINT);\r
-                       lstrcpyn(pItem->pszText, sTemp, pItem->cchTextMax);\r
-               }\r
-#endif\r
+\r
                break;\r
        default:\r
                ASSERT(false);\r
@@ -2982,7 +2955,7 @@ void CLogDlg::OnLvnGetdispinfoLoglist(NMHDR *pNMHDR, LRESULT *pResult)
 \r
 void CLogDlg::OnLvnGetdispinfoChangedFileList(NMHDR *pNMHDR, LRESULT *pResult)\r
 {\r
-#if 0\r
+\r
        NMLVDISPINFO *pDispInfo = reinterpret_cast<NMLVDISPINFO*>(pNMHDR);\r
 \r
        //Create a pointer to the item\r
@@ -3007,44 +2980,58 @@ void CLogDlg::OnLvnGetdispinfoChangedFileList(NMHDR *pNMHDR, LRESULT *pResult)
                        lstrcpyn(pItem->pszText, _T(""), pItem->cchTextMax);\r
                return;\r
        }\r
-       LogChangedPath * lcpath = NULL;\r
+       CTGitPath lcpath = NULL;\r
        if (m_currentChangedArray)\r
-               lcpath = m_currentChangedArray->GetAt(pItem->iItem);\r
+               lcpath = (*m_currentChangedArray)[pItem->iItem];\r
        //Does the list need text information?\r
        if (pItem->mask & LVIF_TEXT)\r
        {\r
                //Which column?\r
                switch (pItem->iSubItem)\r
                {\r
-               case 0: //Action\r
+               case this->FILELIST_ACTION:     //Action\r
+#if 0\r
                        if (lcpath)\r
                                lstrcpyn(pItem->pszText, (LPCTSTR)lcpath->GetAction(), pItem->cchTextMax);\r
                        else\r
                                lstrcpyn(pItem->pszText, _T(""), pItem->cchTextMax);                            \r
+#endif\r
+                       lstrcpyn(pItem->pszText, (LPCTSTR)lcpath.GetActionName(), pItem->cchTextMax);\r
+\r
                        break;\r
-               case 1: //path\r
+\r
+               case this->FILELIST_ADD: //add\r
+#if 0\r
                        if (lcpath)\r
                                lstrcpyn(pItem->pszText, (LPCTSTR)lcpath->sPath, pItem->cchTextMax);\r
                        else\r
                                lstrcpyn(pItem->pszText, (LPCTSTR)m_currentChangedPathList[pItem->iItem].GetGitPathString(), pItem->cchTextMax);\r
+#endif\r
+                       lstrcpyn(pItem->pszText, (LPCTSTR)lcpath.m_StatAdd, pItem->cchTextMax);\r
                        break;\r
-               case 2: //copyfrom path\r
+\r
+               case this->FILELIST_DEL: //del\r
+#if 0\r
                        if (lcpath)\r
                                lstrcpyn(pItem->pszText, (LPCTSTR)lcpath->sCopyFromPath, pItem->cchTextMax);\r
                        else\r
                                lstrcpyn(pItem->pszText, _T(""), pItem->cchTextMax);\r
+#endif\r
+                       lstrcpyn(pItem->pszText, (LPCTSTR)lcpath.m_StatDel, pItem->cchTextMax);\r
                        break;\r
-               case 3: //revision\r
+               case this->FILELIST_PATH: //path\r
+#if 0\r
                        if ((lcpath==NULL)||(lcpath->sCopyFromPath.IsEmpty()))\r
                                lstrcpyn(pItem->pszText, _T(""), pItem->cchTextMax);\r
                        else\r
                                _stprintf_s(pItem->pszText, pItem->cchTextMax, _T("%ld"), lcpath->lCopyFromRev);\r
+#endif\r
+                       lstrcpyn(pItem->pszText, (LPCTSTR)lcpath.GetGitPathString(), pItem->cchTextMax);\r
                        break;\r
                }\r
        }\r
 \r
        *pResult = 0;\r
-#endif\r
 }\r
 \r
 void CLogDlg::OnEnChangeSearchedit()\r
@@ -3555,7 +3542,7 @@ void CLogDlg::OnLvnColumnclickChangedFileList(NMHDR *pNMHDR, LRESULT *pResult)
        const int nColumn = pNMLV->iSubItem;\r
        m_bAscendingPathList = nColumn == m_nSortColumnPathList ? !m_bAscendingPathList : TRUE;\r
        m_nSortColumnPathList = nColumn;\r
-       qsort(m_currentChangedArray->GetData(), m_currentChangedArray->GetSize(), sizeof(LogChangedPath*), (GENERICCOMPAREFN)SortCompare);\r
+//     qsort(m_currentChangedArray->GetData(), m_currentChangedArray->GetSize(), sizeof(LogChangedPath*), (GENERICCOMPAREFN)SortCompare);\r
 \r
        SetSortArrow(&m_ChangedFileListCtrl, m_nSortColumnPathList, m_bAscendingPathList);\r
        m_ChangedFileListCtrl.Invalidate();\r
@@ -3601,7 +3588,7 @@ int CLogDlg::SortCompare(const void * pElem1, const void * pElem2)
 \r
 void CLogDlg::ResizeAllListCtrlCols()\r
 {\r
-#if 0\r
+\r
        const int nMinimumWidth = ICONITEMBORDER+16*4;\r
        int maxcol = ((CHeaderCtrl*)(m_LogList.GetDlgItem(0)))->GetItemCount()-1;\r
        int nItemCount = m_LogList.GetItemCount();\r
@@ -3623,8 +3610,8 @@ void CLogDlg::ResizeAllListCtrlCols()
                                int linewidth = m_LogList.GetStringWidth(m_LogList.GetItemText(index, col)) + 14;\r
                                if (index < m_arShownList.GetCount())\r
                                {\r
-                                       PLOGENTRYDATA pCurLogEntry = reinterpret_cast<PLOGENTRYDATA>(m_arShownList.GetAt(index));\r
-                                       if ((pCurLogEntry)&&(pCurLogEntry->Rev == m_wcRev))\r
+                                       GitRev * pCurLogEntry = reinterpret_cast<GitRev*>(m_arShownList.GetAt(index));\r
+                                       if ((pCurLogEntry)&&(pCurLogEntry->m_CommitHash == m_wcRev.m_CommitHash))\r
                                        {\r
                                                // set the bold font and ask for the string width again\r
                                                m_LogList.SendMessage(WM_SETFONT, (WPARAM)m_boldFont, NULL);\r
@@ -3649,7 +3636,7 @@ void CLogDlg::ResizeAllListCtrlCols()
                                        cx = linewidth;\r
                        }\r
                        // Adjust columns "Actions" containing icons\r
-                       if (col == 1)\r
+                       if (col == this->LOGLIST_ACTION)\r
                        {\r
                                if (cx < nMinimumWidth)\r
                                {\r
@@ -3657,6 +3644,14 @@ void CLogDlg::ResizeAllListCtrlCols()
                                }\r
                        }\r
                        \r
+                       if (col == this->LOGLIST_MESSAGE)\r
+                       {\r
+                               if (cx > LOGLIST_MESSAGE_MAX)\r
+                               {\r
+                                       cx = LOGLIST_MESSAGE_MAX;\r
+                               }\r
+\r
+                       }\r
                        // keep the bug id column small\r
                        if ((col == 4)&&(m_bShowBugtraqColumn))\r
                        {\r
@@ -3669,7 +3664,7 @@ void CLogDlg::ResizeAllListCtrlCols()
                        m_LogList.SetColumnWidth(col, cx);\r
                }\r
        }\r
-#endif\r
+\r
 }\r
 \r
 void CLogDlg::OnBnClickedHidepaths()\r
index 2e691c9..8892d15 100644 (file)
@@ -69,6 +69,24 @@ public:
        CLogDlg(CWnd* pParent = NULL);   // standard constructor\r
        virtual ~CLogDlg();\r
 \r
+       enum\r
+       {\r
+               LOGLIST_GRAPH,\r
+               LOGLIST_ACTION,\r
+               LOGLIST_MESSAGE,\r
+               LOGLIST_AUTHOR,\r
+               LOGLIST_DATE,\r
+               LOGLIST_BUG,\r
+               LOGLIST_MESSAGE_MAX=250\r
+       };\r
+\r
+       enum\r
+       {\r
+               FILELIST_ACTION,\r
+               FILELIST_ADD,\r
+               FILELIST_DEL,\r
+               FILELIST_PATH\r
+       };\r
 \r
        void SetParams(const CTGitPath& path, GitRev pegrev, GitRev startrev, GitRev endrev, int limit, \r
                BOOL bStrict = CRegDWORD(_T("Software\\TortoiseGit\\LastLogStrict"), FALSE), BOOL bSaveStrict = TRUE);\r
@@ -221,7 +239,7 @@ private:
        BOOL                            m_bIncludeMerges;\r
        git_revnum_t            m_lowestRev;\r
        BOOL                            m_bSaveStrict;\r
-       LogChangedPathArray * m_currentChangedArray;\r
+       CTGitPathList   *   m_currentChangedArray;\r
        LogChangedPathArray m_CurrentFilteredChangedArray;\r
        CTGitPathList           m_currentChangedPathList;\r
        CPtrArray                       m_arShownList;\r
index ce5b2b6..e9db27b 100644 (file)
@@ -10,7 +10,7 @@
                        >\r
                        <DebugSettings\r
                                Command="$(TargetPath)"\r
-                               WorkingDirectory="D:\Profiles\b20596\tortoisegit"\r
+                               WorkingDirectory="D:\Profiles\b20596\qgit4"\r
                                CommandArguments="/command:log"\r
                                Attach="false"\r
                                DebuggerType="3"\r
index 228bb80..6edaea9 100644 (file)
Binary files a/TortoiseProc/resource.h and b/TortoiseProc/resource.h differ
index 6334fe2..a33f88d 100644 (file)
Binary files a/TortoiseShell/TortoiseShell.suo and b/TortoiseShell/TortoiseShell.suo differ