OSDN Git Service

Commit File List can show file and sort
authorFrank Li <lznuaa@gmail.com>
Mon, 24 Nov 2008 15:20:45 +0000 (23:20 +0800)
committerFrank Li <lznuaa@gmail.com>
Mon, 24 Nov 2008 15:20:45 +0000 (23:20 +0800)
Git/GitStatusListCtrl.cpp
Git/GitStatusListCtrl.h
Git/TGitPath.h
Resources/TortoiseProcENG.rc
TortoiseProc/CommitDlg.cpp
TortoiseProc/FileDiffDlg.cpp
TortoiseProc/GitStatusListCtrlHelpers.cpp
TortoiseProc/RevisionDlg.cpp
TortoiseProc/TortoiseProc.vcproj
TortoiseProc/TortoiseProc.vcproj.FSL.B20596.user
TortoiseShell/TortoiseShell.suo

index c8591d3..840da36 100644 (file)
@@ -168,21 +168,26 @@ CGitStatusListCtrl::~CGitStatusListCtrl()
 \r
 void CGitStatusListCtrl::ClearStatusArray()\r
 {\r
+#if 0\r
        Locker lock(m_critSec);\r
        for (size_t i=0; i < m_arStatusArray.size(); i++)\r
        {\r
                delete m_arStatusArray[i];\r
        }\r
        m_arStatusArray.clear();\r
+#endif\r
 }\r
 \r
 CGitStatusListCtrl::FileEntry * CGitStatusListCtrl::GetListEntry(UINT_PTR index)\r
 {\r
+#if 0\r
        if (index >= (UINT_PTR)m_arListArray.size())\r
                return NULL;\r
        if (m_arListArray[index] >= m_arStatusArray.size())\r
                return NULL;\r
        return m_arStatusArray[m_arListArray[index]];\r
+#endif\r
+       return NULL;\r
 }\r
 \r
 CGitStatusListCtrl::FileEntry * CGitStatusListCtrl::GetVisibleListEntry(const CTGitPath& path)\r
@@ -199,12 +204,14 @@ CGitStatusListCtrl::FileEntry * CGitStatusListCtrl::GetVisibleListEntry(const CT
 \r
 CGitStatusListCtrl::FileEntry * CGitStatusListCtrl::GetListEntry(const CTGitPath& path)\r
 {\r
+#if 0\r
        for (size_t i=0; i < m_arStatusArray.size(); i++)\r
        {\r
                FileEntry * entry = m_arStatusArray[i];\r
                if (entry->GetPath().IsEquivalentTo(path))\r
                        return entry;\r
        }\r
+#endif\r
        return NULL;\r
 }\r
 \r
@@ -277,6 +284,7 @@ BOOL CGitStatusListCtrl::GetStatus ( const CTGitPathList& pathList
                                    , bool bShowIgnores /* = false */\r
                                    , bool bShowUserProps /* = false */)\r
 {\r
+#if 0\r
        Locker lock(m_critSec);\r
        int refetchcounter = 0;\r
        BOOL bRet = TRUE;\r
@@ -287,7 +295,7 @@ BOOL CGitStatusListCtrl::GetStatus ( const CTGitPathList& pathList
        SetCursorPos(pt.x, pt.y);\r
 \r
        m_mapFilenameToChecked.clear();\r
-       m_StatusUrlList.Clear();\r
+       //m_StatusUrlList.Clear();\r
        bool bHasChangelists = (m_changelists.size()>1 || (m_changelists.size()>0 && !m_bHasIgnoreGroup));\r
        m_changelists.clear();\r
        for (size_t i=0; i < m_arStatusArray.size(); i++)\r
@@ -439,6 +447,8 @@ BOOL CGitStatusListCtrl::GetStatus ( const CTGitPathList& pathList
        GetCursorPos(&pt);\r
        SetCursorPos(pt.x, pt.y);\r
        return bRet;\r
+#endif \r
+       return TRUE;\r
 }\r
 \r
 //\r
@@ -1022,9 +1032,68 @@ DWORD CGitStatusListCtrl::GetShowFlagsFromGitStatus(git_wc_status_kind status)
 \r
 void CGitStatusListCtrl::Show(DWORD dwShow, DWORD dwCheck /*=0*/, bool bShowFolders /* = true */)\r
 {\r
+       CWinApp * pApp = AfxGetApp();\r
+       if (pApp)\r
+               pApp->DoWaitCursor(1);\r
 \r
        Locker lock(m_critSec);\r
        WORD langID = (WORD)CRegStdWORD(_T("Software\\TortoiseSVN\\LanguageID"), GetUserDefaultLangID());\r
+       \r
+       //SetItemCount(listIndex);\r
+       SetRedraw(FALSE);\r
+       DeleteAllItems();\r
+\r
+       for(int i=0;i<this->m_arStatusArray.size();i++)\r
+       {\r
+               AddEntry((CTGitPath*)m_arStatusArray[i],langID,i);\r
+       }\r
+       \r
+       int maxcol = ((CHeaderCtrl*)(GetDlgItem(0)))->GetItemCount()-1;\r
+       for (int col = 0; col <= maxcol; col++)\r
+        SetColumnWidth (col, m_ColumnManager.GetWidth (col, true));\r
+\r
+    SetRedraw(TRUE);\r
+       GetStatisticsString();\r
+\r
+       CHeaderCtrl * pHeader = GetHeaderCtrl();\r
+       HDITEM HeaderItem = {0};\r
+       HeaderItem.mask = HDI_FORMAT;\r
+       for (int i=0; i<pHeader->GetItemCount(); ++i)\r
+       {\r
+               pHeader->GetItem(i, &HeaderItem);\r
+               HeaderItem.fmt &= ~(HDF_SORTDOWN | HDF_SORTUP);\r
+               pHeader->SetItem(i, &HeaderItem);\r
+       }\r
+       if (m_nSortedColumn)\r
+       {\r
+               pHeader->GetItem(m_nSortedColumn, &HeaderItem);\r
+               HeaderItem.fmt |= (m_bAscending ? HDF_SORTUP : HDF_SORTDOWN);\r
+               pHeader->SetItem(m_nSortedColumn, &HeaderItem);\r
+       }\r
+\r
+#if 0\r
+       if (nSelectedEntry)\r
+       {\r
+               SetItemState(nSelectedEntry, LVIS_SELECTED, LVIS_SELECTED);\r
+               EnsureVisible(nSelectedEntry, false);\r
+       }\r
+       else\r
+       {\r
+               // Restore the item at the top of the list.\r
+               for (int i=0;GetTopIndex() != nTopIndex;i++)\r
+               {\r
+                       if ( !EnsureVisible(nTopIndex+i,false) )\r
+                       {\r
+                               break;\r
+                       }\r
+               }\r
+       }\r
+#endif\r
+       if (pApp)\r
+               pApp->DoWaitCursor(-1);\r
+\r
+       Invalidate();\r
+#if 0\r
 \r
        CWinApp * pApp = AfxGetApp();\r
        if (pApp)\r
@@ -1161,11 +1230,14 @@ void CGitStatusListCtrl::Show(DWORD dwShow, DWORD dwCheck /*=0*/, bool bShowFold
 \r
        m_bEmpty = (GetItemCount() == 0);\r
        Invalidate();\r
+#endif\r
 \r
 }\r
 \r
 void CGitStatusListCtrl::Show(DWORD dwShow, const CTGitPathList& checkedList, bool bShowFolders /* = true */)\r
 {\r
+       return ;\r
+#if 0\r
 \r
        Locker lock(m_critSec);\r
        WORD langID = (WORD)CRegStdWORD(_T("Software\\TortoiseSVN\\LanguageID"), GetUserDefaultLangID());\r
@@ -1294,9 +1366,232 @@ void CGitStatusListCtrl::Show(DWORD dwShow, const CTGitPathList& checkedList, bo
 \r
        m_bEmpty = (GetItemCount() == 0);\r
        Invalidate();\r
+#endif\r
 \r
 }\r
+void CGitStatusListCtrl::AddEntry(CTGitPath * GitPath, WORD langID, int listIndex)\r
+{\r
+       static CString ponly(MAKEINTRESOURCE(IDS_STATUSLIST_PROPONLY));\r
+       static HINSTANCE hResourceHandle(AfxGetResourceHandle());\r
+\r
+       CString path = GitPath->GetGitPathString();\r
+\r
+       m_bBlock = TRUE;\r
+       TCHAR buf[100];\r
+       int index = listIndex;\r
+       int nCol = 1;\r
+       CString entryname = GitPath->GetGitPathString();\r
+       int icon_idx = 0;\r
+//     if (entry->isfolder)\r
+//             icon_idx = m_nIconFolder;\r
+//     else\r
+       {\r
+               icon_idx = SYS_IMAGE_LIST().GetPathIconIndex(*GitPath);\r
+       }\r
+       // relative path\r
+       InsertItem(index, entryname, icon_idx);\r
+\r
+       this->SetItemData(index, (DWORD_PTR)GitPath);\r
+       // SVNSLC_COLFILENAME\r
+       SetItemText(index, nCol++, GitPath->GetFileOrDirectoryName());\r
+       // SVNSLC_COLEXT\r
+       SetItemText(index, nCol++, GitPath->GetFileExtension());\r
+       // SVNSLC_COLSTATUS\r
+//     if (entry->isNested)\r
+//     {\r
+//             CString sTemp(MAKEINTRESOURCE(IDS_STATUSLIST_NESTED));\r
+//             SetItemText(index, nCol++, sTemp);\r
+//     }\r
+//     else\r
+       {\r
+               SetItemText(index, nCol++, GitPath->GetActionName());\r
+       }\r
+       // SVNSLC_COLREMOTESTATUS\r
+//     if (entry->isNested)\r
+//     {\r
+//             CString sTemp(MAKEINTRESOURCE(IDS_STATUSLIST_NESTED));\r
+//             SetItemText(index, nCol++, sTemp);\r
+//     }\r
+//     else\r
+       {\r
+               //SetItemText(index, nCol++, buf);\r
+       }\r
+       // SVNSLC_COLTEXTSTATUS\r
+//     if (entry->isNested)\r
+//     {\r
+//             CString sTemp(MAKEINTRESOURCE(IDS_STATUSLIST_NESTED));\r
+//             SetItemText(index, nCol++, sTemp);\r
+//     }\r
+//     else\r
+//     {\r
+#if 0\r
+               SVNStatus::GetStatusString(hResourceHandle, entry->textstatus, buf, sizeof(buf)/sizeof(TCHAR), (WORD)langID);\r
+               if ((entry->copied)&&(_tcslen(buf)>1))\r
+                       _tcscat_s(buf, 100, _T(" (+)"));\r
+               if ((entry->switched)&&(_tcslen(buf)>1))\r
+                       _tcscat_s(buf, 100, _T(" (s)"));\r
+#endif\r
+//             SetItemText(index, nCol++, buf);\r
+//     }\r
+       // SVNSLC_COLPROPSTATUS\r
+//     if (entry->isNested)\r
+//     {\r
+//             SetItemText(index, nCol++, _T(""));\r
+//     }\r
+//     else\r
+//     {\r
+#if 0\r
+               SVNStatus::GetStatusString(hResourceHandle, entry->propstatus, buf, sizeof(buf)/sizeof(TCHAR), (WORD)langID);\r
+               if ((entry->copied)&&(_tcslen(buf)>1))\r
+                       _tcscat_s(buf, 100, _T(" (+)"));\r
+               if ((entry->switched)&&(_tcslen(buf)>1))\r
+                       _tcscat_s(buf, 100, _T(" (s)"));\r
+#endif\r
+//             SetItemText(index, nCol++, buf);\r
+//     }\r
+       // SVNSLC_COLREMOTETEXT\r
+//     if (entry->isNested)\r
+//     {\r
+//             SetItemText(index, nCol++, _T(""));\r
+//     }\r
+//     else\r
+//     {\r
+#if 0\r
+               SVNStatus::GetStatusString(hResourceHandle, entry->remotetextstatus, buf, sizeof(buf)/sizeof(TCHAR), (WORD)langID);\r
+               SetItemText(index, nCol++, buf);\r
+#endif\r
+//     }\r
+       // SVNSLC_COLREMOTEPROP\r
+//     if (entry->isNested)\r
+//     {\r
+//             SetItemText(index, nCol++, _T(""));\r
+//     }\r
+//     else\r
+//     {\r
+//             SVNStatus::GetStatusString(hResourceHandle, entry->remotepropstatus, buf, sizeof(buf)/sizeof(TCHAR), (WORD)langID);\r
+//             SetItemText(index, nCol++, buf);\r
+//     }\r
+       // SVNSLC_COLURL\r
+//     SetItemText(index, nCol++, entry->url);\r
+       // SVNSLC_COLLOCK\r
+#if 0\r
+       if (!m_HeadRev.IsHead())\r
+       {\r
+               // we have contacted the repository\r
 \r
+               // decision-matrix\r
+               // wc           repository              text\r
+               // ""           ""                              ""\r
+               // ""           UID1                    owner\r
+               // UID1         UID1                    owner\r
+               // UID1         ""                              lock has been broken\r
+               // UID1         UID2                    lock has been stolen\r
+               if (entry->lock_token.IsEmpty() || (entry->lock_token.Compare(entry->lock_remotetoken)==0))\r
+               {\r
+                       if (entry->lock_owner.IsEmpty())\r
+                               SetItemText(index, nCol++, entry->lock_remoteowner);\r
+                       else\r
+                               SetItemText(index, nCol++, entry->lock_owner);\r
+               }\r
+               else if (entry->lock_remotetoken.IsEmpty())\r
+               {\r
+                       // broken lock\r
+                       CString temp(MAKEINTRESOURCE(IDS_STATUSLIST_LOCKBROKEN));\r
+                       SetItemText(index, nCol++, temp);\r
+               }\r
+               else\r
+               {\r
+                       // stolen lock\r
+                       CString temp;\r
+                       temp.Format(IDS_STATUSLIST_LOCKSTOLEN, (LPCTSTR)entry->lock_remoteowner);\r
+                       SetItemText(index, nCol++, temp);\r
+               }\r
+       }\r
+       else\r
+               SetItemText(index, nCol++, entry->lock_owner);\r
+       // SVNSLC_COLLOCKCOMMENT\r
+       SetItemText(index, nCol++, entry->lock_comment);\r
+       // SVNSLC_COLAUTHOR\r
+       SetItemText(index, nCol++, entry->last_commit_author);\r
+       // SVNSLC_COLREVISION\r
+       CString temp;\r
+       temp.Format(_T("%ld"), entry->last_commit_rev);\r
+       if (entry->last_commit_rev > 0)\r
+               SetItemText(index, nCol++, temp);\r
+       else\r
+               SetItemText(index, nCol++, _T(""));\r
+       // SVNSLC_COLREMOTEREVISION\r
+       temp.Format(_T("%ld"), entry->remoterev);\r
+       if (entry->remoterev > 0)\r
+               SetItemText(index, nCol++, temp);\r
+       else\r
+               SetItemText(index, nCol++, _T(""));\r
+       // SVNSLC_COLDATE\r
+       TCHAR datebuf[SVN_DATE_BUFFER];\r
+       apr_time_t date = entry->last_commit_date;\r
+       SVN::formatDate(datebuf, date, true);\r
+       if (date)\r
+               SetItemText(index, nCol++, datebuf);\r
+       else\r
+               SetItemText(index, nCol++, _T(""));\r
+       // SVNSLC_COLSVNNEEDSLOCK\r
+    BOOL bFoundSVNNeedsLock = entry->present_props.IsNeedsLockSet();\r
+       CString strSVNNeedsLock = (bFoundSVNNeedsLock) ? _T("*") : _T("");\r
+       SetItemText(index, nCol++, strSVNNeedsLock);\r
+       // SVNSLC_COLCOPYFROM\r
+       if (m_sURL.Compare(entry->copyfrom_url.Left(m_sURL.GetLength()))==0)\r
+               temp = entry->copyfrom_url.Mid(m_sURL.GetLength());\r
+       else\r
+               temp = entry->copyfrom_url;\r
+       SetItemText(index, nCol++, temp);\r
+       // SVNSLC_COLMODIFICATIONDATE\r
+       __int64 filetime = entry->GetPath().GetLastWriteTime();\r
+       if ( (filetime) && (entry->status!=git_wc_status_deleted) )\r
+       {\r
+               FILETIME* f = (FILETIME*)(__int64*)&filetime;\r
+               TCHAR datebuf[SVN_DATE_BUFFER];\r
+               SVN::formatDate(datebuf,*f,true);\r
+               SetItemText(index, nCol++, datebuf);\r
+       }\r
+       else\r
+       {\r
+               SetItemText(index, nCol++, _T(""));\r
+       }\r
+\r
+    // user-defined properties\r
+    for ( int i = SVNSLC_NUMCOLUMNS, count = m_ColumnManager.GetColumnCount()\r
+        ; i < count\r
+        ; ++i)\r
+    {\r
+        assert (i == nCol++);\r
+        assert (m_ColumnManager.IsUserProp (i));\r
+\r
+        CString name = m_ColumnManager.GetName(i);\r
+        if (entry->present_props.HasProperty (name))\r
+               {\r
+                       const CString& propVal = entry->present_props [name];\r
+                       if (propVal.IsEmpty())\r
+                               SetItemText(index, i, m_sNoPropValueText);\r
+                       else\r
+                               SetItemText(index, i, propVal);\r
+               }\r
+               else\r
+            SetItemText(index, i, _T(""));\r
+    }\r
+#endif\r
+       SetCheck(index, GitPath->m_Checked);\r
+       if (GitPath->m_Checked)\r
+               m_nSelected++;\r
+#if 0\r
+       if (m_changelists.find(entry->changelist) != m_changelists.end())\r
+               SetItemGroup(index, m_changelists[entry->changelist]);\r
+       else\r
+               SetItemGroup(index, 0);\r
+       m_bBlock = FALSE;\r
+#endif\r
+\r
+}\r
+#if 0\r
 void CGitStatusListCtrl::AddEntry(FileEntry * entry, WORD langID, int listIndex)\r
 {\r
        static CString ponly(MAKEINTRESOURCE(IDS_STATUSLIST_PROPONLY));\r
@@ -1546,7 +1841,7 @@ void CGitStatusListCtrl::AddEntry(FileEntry * entry, WORD langID, int listIndex)
        m_bBlock = FALSE;\r
 #endif\r
 }\r
-\r
+#endif\r
 bool CGitStatusListCtrl::SetItemGroup(int item, int groupindex)\r
 {\r
        if ((m_dwContextMenus & SVNSLC_POPCHANGELISTS) == NULL)\r
@@ -1571,6 +1866,7 @@ void CGitStatusListCtrl::Sort()
        std::sort(m_arStatusArray.begin(), m_arStatusArray.end(), predicate);\r
        SaveColumnWidths();\r
        Show(m_dwShow, 0, m_bShowFolders);\r
+\r
 }\r
 \r
 void CGitStatusListCtrl::OnHdnItemclick(NMHDR *pNMHDR, LRESULT *pResult)\r
@@ -1602,10 +1898,11 @@ void CGitStatusListCtrl::OnHdnItemclick(NMHDR *pNMHDR, LRESULT *pResult)
        pHeader->SetItem(m_nSortedColumn, &HeaderItem);\r
 \r
        // the checked state of the list control items must be restored\r
+\r
        for (int i=0; i<GetItemCount(); ++i)\r
        {\r
-               FileEntry * entry = GetListEntry(i);\r
-               SetCheck(i, entry->IsChecked());\r
+               CTGitPath * entry = (CTGitPath*)GetItemData(i);\r
+               SetCheck(i, entry->m_Checked);\r
        }\r
 \r
        m_bBlock = FALSE;\r
@@ -1641,6 +1938,10 @@ BOOL CGitStatusListCtrl::OnLvnItemchanged(NMHDR *pNMHDR, LRESULT *pResult)
 \r
        m_bBlock = TRUE;\r
        // was the item checked?\r
+       \r
+       CTGitPath *gitpath=(CTGitPath*)GetItemData(pNMLV->iItem);\r
+       gitpath->m_Checked=GetCheck(pNMLV->iItem);\r
+#if 0\r
        if (GetCheck(pNMLV->iItem))\r
        {\r
                CheckEntry(pNMLV->iItem, nListItems);\r
@@ -1669,6 +1970,7 @@ BOOL CGitStatusListCtrl::OnLvnItemchanged(NMHDR *pNMHDR, LRESULT *pResult)
                        }\r
                }\r
        }\r
+#endif\r
        GetStatisticsString();\r
        m_bBlock = FALSE;\r
        NotifyCheck();\r
@@ -1846,6 +2148,7 @@ bool CGitStatusListCtrl::IsEntryVersioned(const FileEntry* pEntry1)
 \r
 bool CGitStatusListCtrl::BuildStatistics()\r
 {\r
+#if 0\r
        bool bRefetchStatus = false;\r
        FileEntryVector::iterator itFirstUnversionedEntry;\r
        itFirstUnversionedEntry = std::partition(m_arStatusArray.begin(), m_arStatusArray.end(), IsEntryVersioned);\r
@@ -1948,6 +2251,8 @@ bool CGitStatusListCtrl::BuildStatistics()
                } // if (entry)\r
        } // for (int i=0; i < (int)m_arStatusArray.size(); ++i)\r
        return !bRefetchStatus;\r
+#endif \r
+       return FALSE;\r
 }\r
 \r
 void CGitStatusListCtrl::GetMinMaxRevisions(git_revnum_t& rMin, git_revnum_t& rMax, bool bShownOnly, bool bCheckedOnly)\r
@@ -4102,6 +4407,7 @@ BOOL CGitStatusListCtrl::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
 \r
 void CGitStatusListCtrl::RemoveListEntry(int index)\r
 {\r
+#if 0\r
        Locker lock(m_critSec);\r
        DeleteItem(index);\r
        delete m_arStatusArray[m_arListArray[index]];\r
@@ -4111,6 +4417,7 @@ void CGitStatusListCtrl::RemoveListEntry(int index)
        {\r
                m_arListArray[i]--;\r
        }\r
+#endif\r
 }\r
 \r
 ///< Set a checkbox on an entry in the listbox\r
@@ -4524,12 +4831,14 @@ bool CGitStatusListCtrl::EnableFileDrop()
 \r
 bool CGitStatusListCtrl::HasPath(const CTGitPath& path)\r
 {\r
+#if 0\r
        for (size_t i=0; i < m_arStatusArray.size(); i++)\r
        {\r
                FileEntry * entry = m_arStatusArray[i];\r
                if (entry->GetPath().IsEquivalentTo(path))\r
                        return true;\r
        }\r
+#endif\r
        return false;\r
 }\r
 \r
@@ -4915,7 +5224,23 @@ void CGitStatusListCtrl::NotifyCheck()
        }\r
 }\r
 \r
-\r
+int CGitStatusListCtrl::UpdateFileList(git_revnum_t hash)\r
+{\r
+       CString out;\r
+       if(hash == GIT_REV_ZERO)\r
+       {\r
+               CString cmd(_T("git.cmd diff-index --raw HEAD --numstat -C -M"));\r
+               g_Git.Run(cmd,&out);\r
+               this->m_StatusFileList.ParserFromLog(out);\r
+       }\r
+       for(int i=0;i<m_StatusFileList.GetCount();i++)\r
+       {\r
+               CTGitPath * gitpatch=(CTGitPath*)&m_StatusFileList[i];\r
+               gitpatch->m_Checked = TRUE;\r
+               m_arStatusArray.push_back((CTGitPath*)&m_StatusFileList[i]);\r
+       }\r
+       return 0;\r
+}\r
 //////////////////////////////////////////////////////////////////////////\r
 #if 0\r
 bool CGitStatusListCtrlDropTarget::OnDrop(FORMATETC* pFmtEtc, STGMEDIUM& medium, DWORD * /*pdwEffect*/, POINTL pt)\r
@@ -5049,6 +5374,6 @@ HRESULT STDMETHODCALLTYPE CSVNStatusListCtrlDropTarget::DragOver(DWORD grfKeySta
                }\r
        }\r
        return S_OK;\r
-}\r
+}f\r
 \r
 #endif
\ No newline at end of file
index bbb70d4..44af8ee 100644 (file)
@@ -445,6 +445,7 @@ public:
         /// global column ordering including unused user props\r
 \r
         std::vector<int> columnOrder;\r
+\r
     };/**\r
         * \ingroup TortoiseProc\r
         * Simple utility class that defines the sort column order.\r
@@ -457,8 +458,8 @@ public:
                 , int sortedColumn\r
                 , bool ascending);\r
 \r
-        bool operator() ( const FileEntry* entry1\r
-                        , const FileEntry* entry2) const;\r
+        bool operator() ( const CTGitPath* entry1\r
+                        , const CTGitPath* entry2) const;\r
 \r
     private:\r
 \r
@@ -830,14 +831,15 @@ private:
        BOOL                                            m_bHasUnversionedItems;\r
        bool                                            m_bHasLocks;\r
        bool                                            m_bHasChangeLists;\r
-       typedef std::vector<FileEntry*> FileEntryVector;\r
-       FileEntryVector                         m_arStatusArray;\r
+       //typedef std::vector<FileEntry*> FileEntryVector;\r
+       //FileEntryVector                               m_arStatusArray;\r
+       std::vector<CTGitPath*>         m_arStatusArray;\r
        std::vector<size_t>                     m_arListArray;\r
        std::map<CString, int>      m_changelists;\r
        bool                                            m_bHasIgnoreGroup;\r
-       CTGitPathList                           m_ConflictFileList;\r
+       //CTGitPathList                         m_ConflictFileList;\r
        CTGitPathList                           m_StatusFileList;\r
-       CTGitPathList                           m_StatusUrlList;\r
+       //CTGitPathList                         m_StatusUrlList;\r
        CString                                         m_sLastError;\r
 \r
        LONG                                            m_nUnversioned;\r
@@ -886,6 +888,9 @@ private:
        CComCriticalSection                     m_critSec;\r
 \r
        friend class CGitStatusListCtrlDropTarget;\r
+public:\r
+       int UpdateFileList(git_revnum_t hash);\r
+       void AddEntry(CTGitPath* path, WORD langID, int ListIndex);\r
 };\r
 \r
 #if 0\r
index e49804d..b7145d7 100644 (file)
@@ -13,12 +13,15 @@ public:
                LOGACTIONS_ADDED        = 0x00000001,\r
                LOGACTIONS_MODIFIED     = 0x00000002,\r
                LOGACTIONS_REPLACED     = 0x00000004,\r
-               LOGACTIONS_DELETED      = 0x00000008\r
+               LOGACTIONS_DELETED      = 0x00000008,\r
+               LOGACTIONS_UNVER        = 0x80000000,\r
+               LOGACTIONS_IGNORE       = 0x40000000\r
        };\r
 \r
        CString m_StatAdd;\r
        CString m_StatDel;\r
        int             m_Action;\r
+       bool    m_Checked;\r
        int     ParserAction(CString action);\r
        CString GetActionName();\r
        /**\r
index c704031..2265151 100644 (file)
Binary files a/Resources/TortoiseProcENG.rc and b/Resources/TortoiseProcENG.rc differ
index c0236aa..c871ecc 100644 (file)
@@ -591,6 +591,9 @@ UINT CCommitDlg::StatusThread()
 #endif\r
     // Initialise the list control with the status of the files/folders below us\r
        BOOL success = m_ListCtrl.GetStatus(m_pathList);\r
+\r
+       m_ListCtrl.UpdateFileList(GIT_REV_ZERO);\r
+       \r
        m_ListCtrl.CheckIfChangelistsArePresent(false);\r
 \r
        DWORD dwShow = SVNSLC_SHOWVERSIONEDBUTNORMALANDEXTERNALSFROMDIFFERENTREPOS | SVNSLC_SHOWLOCKS | SVNSLC_SHOWINCHANGELIST;\r
@@ -627,17 +630,17 @@ UINT CCommitDlg::StatusThread()
        }\r
        if ((m_ListCtrl.GetItemCount()==0)&&(m_ListCtrl.HasUnversionedItems()))\r
        {\r
-               if (CMessageBox::Show(m_hWnd, IDS_COMMITDLG_NOTHINGTOCOMMITUNVERSIONED, IDS_APPNAME, MB_ICONINFORMATION | MB_YESNO)==IDYES)\r
-               {\r
-                       m_bShowUnversioned = TRUE;\r
-                       GetDlgItem(IDC_SHOWUNVERSIONED)->SendMessage(BM_SETCHECK, BST_CHECKED);\r
-                       DWORD dwShow = SVNSLC_SHOWVERSIONEDBUTNORMALANDEXTERNALSFROMDIFFERENTREPOS | SVNSLC_SHOWUNVERSIONED | SVNSLC_SHOWLOCKS;\r
-                       m_ListCtrl.Show(dwShow);\r
-               }\r
+//             if (CMessageBox::Show(m_hWnd, IDS_COMMITDLG_NOTHINGTOCOMMITUNVERSIONED, IDS_APPNAME, MB_ICONINFORMATION | MB_YESNO)==IDYES)\r
+//             {\r
+//                     m_bShowUnversioned = TRUE;\r
+//                     GetDlgItem(IDC_SHOWUNVERSIONED)->SendMessage(BM_SETCHECK, BST_CHECKED);\r
+//                     DWORD dwShow = SVNSLC_SHOWVERSIONEDBUTNORMALANDEXTERNALSFROMDIFFERENTREPOS | SVNSLC_SHOWUNVERSIONED | SVNSLC_SHOWLOCKS;\r
+//                     m_ListCtrl.Show(dwShow);\r
+//             }\r
        }\r
 \r
-       CTGitPath commonDir = m_ListCtrl.GetCommonDirectory(false);\r
-       SetWindowText(m_sWindowTitle + _T(" - ") + commonDir.GetWinPathString());\r
+//     CTGitPath commonDir = m_ListCtrl.GetCommonDirectory(false);\r
+//     SetWindowText(m_sWindowTitle + _T(" - ") + commonDir.GetWinPathString());\r
 \r
        m_autolist.clear();\r
        // we don't have to block the commit dialog while we fetch the\r
@@ -1357,10 +1360,16 @@ void CCommitDlg::OnSize(UINT nType, int cx, int cy)
 void CCommitDlg::OnBnClickedSignOff()\r
 {\r
        // TODO: Add your control notification handler code here\r
-       CGit git;\r
        CString str;\r
-       str.Format(_T("Signed-off-by: %s <%s>\n"),git.GetUserName(), git.GetUserEmail());\r
-       m_cLogMessage.InsertText(str,true);\r
+       CString username;\r
+       CString email;\r
+       username=g_Git.GetUserName();\r
+       email=g_Git.GetUserEmail();\r
+       username.Remove(_T('\n'));\r
+       email.Remove(_T('\n'));\r
+       str.Format(_T("Signed-off-by: %s <%s>\n"),username,email);\r
+\r
+       m_cLogMessage.SetText(m_cLogMessage.GetText()+_T("\r\n\r\n")+str);\r
 }\r
 \r
 void CCommitDlg::OnStnClickedCommitlabel()\r
index 2c9b5fb..dd328af 100644 (file)
@@ -841,15 +841,16 @@ void CFileDiffDlg::OnBnClickedSwitchleftright()
 \r
 void CFileDiffDlg::SetURLLabels()\r
 {\r
-#if 0\r
-       m_cRev1Btn.SetWindowText(m_rev1.ToString());\r
-       m_cRev2Btn.SetWindowText(m_rev2.ToString());\r
 \r
-       SetDlgItemText(IDC_FIRSTURL, m_path1.GetGitPathString());\r
-       SetDlgItemText(IDC_SECONDURL, m_bDoPegDiff ? m_path1.GetGitPathString() : m_path2.GetGitPathString());\r
-       m_tooltips.AddTool(IDC_FIRSTURL, m_path1.GetGitPathString());\r
-       m_tooltips.AddTool(IDC_SECONDURL, m_bDoPegDiff ? m_path1.GetGitPathString() : m_path2.GetGitPathString());\r
-#endif\r
+       m_cRev1Btn.SetWindowText(m_rev1.m_CommitHash.Left(6));\r
+       m_cRev2Btn.SetWindowText(m_rev2.m_CommitHash.Left(6));\r
+\r
+       SetDlgItemText(IDC_FIRSTURL, m_rev1.m_Subject+CString(_T("\r\n"))+m_rev1.m_CommitHash);\r
+       SetDlgItemText(IDC_SECONDURL,m_rev2.m_Subject+CString(_T("\r\n"))+m_rev2.m_CommitHash);\r
+\r
+       m_tooltips.AddTool(IDC_FIRSTURL,  m_rev1.m_AuthorDate.Format(_T("%Y-%m-%d  "))+m_rev1.m_AuthorName);\r
+       m_tooltips.AddTool(IDC_SECONDURL, m_rev2.m_AuthorDate.Format(_T("%Y-%m-%d  "))+m_rev2.m_AuthorName);\r
+\r
 }\r
 \r
 BOOL CFileDiffDlg::PreTranslateMessage(MSG* pMsg)\r
index 0542747..6372d55 100644 (file)
@@ -113,7 +113,7 @@ void CGitStatusListCtrl::ColumnManager::ReadSettings
         columns[i].relevant = true;\r
     }\r
 \r
-    userProps.clear();\r
+//    userProps.clear();\r
 \r
     // where the settings are stored within the registry\r
 \r
@@ -295,8 +295,8 @@ CString CGitStatusListCtrl::ColumnManager::GetName (int column) const
 \r
     // user-prop columns\r
 \r
-    if (index < columns.size())\r
-        return userProps[columns[index].index - SVNSLC_USERPROPCOLOFFSET].name;\r
+//    if (index < columns.size())\r
+//        return userProps[columns[index].index - SVNSLC_USERPROPCOLOFFSET].name;\r
 \r
     // default: empty\r
 \r
@@ -904,8 +904,8 @@ CGitStatusListCtrl::CSorter::CSorter ( ColumnManager* columnManager
 }\r
 \r
 bool CGitStatusListCtrl::CSorter::operator()\r
-( const FileEntry* entry1\r
- , const FileEntry* entry2) const\r
+( const CTGitPath* entry1\r
+ , const CTGitPath* entry2) const\r
 {\r
 #define SGN(x) ((x)==0?0:((x)>0?1:-1))\r
 \r
@@ -916,8 +916,8 @@ bool CGitStatusListCtrl::CSorter::operator()
                {\r
                        if (result == 0)\r
                        {\r
-                               __int64 writetime1 = entry1->GetPath().GetLastWriteTime();\r
-                               __int64 writetime2 = entry2->GetPath().GetLastWriteTime();\r
+                               __int64 writetime1 = entry1->GetLastWriteTime();\r
+                               __int64 writetime2 = entry2->GetLastWriteTime();\r
 \r
                                FILETIME* filetime1 = (FILETIME*)(__int64*)&writetime1;\r
                                FILETIME* filetime2 = (FILETIME*)(__int64*)&writetime2;\r
@@ -936,35 +936,35 @@ bool CGitStatusListCtrl::CSorter::operator()
                {\r
                        if (result == 0)\r
                        {\r
-                               result = SGN(entry1->needslock - entry2->needslock);\r
+//                             result = SGN(entry1->needslock - entry2->needslock);\r
                        }\r
                }\r
        case 15:\r
                {\r
                        if (result == 0)\r
                        {\r
-                               result = SGN(entry1->last_commit_date - entry2->last_commit_date);\r
+//                             result = SGN(entry1->last_commit_date - entry2->last_commit_date);\r
                        }\r
                }\r
        case 14:\r
                {\r
                        if (result == 0)\r
                        {\r
-                               result = entry1->remoterev - entry2->remoterev;\r
+//                             result = entry1->remoterev - entry2->remoterev;\r
                        }\r
                }\r
        case 13:\r
                {\r
                        if (result == 0)\r
                        {\r
-                               result = entry1->last_commit_rev - entry2->last_commit_rev;\r
+//                             result = entry1->last_commit_rev - entry2->last_commit_rev;\r
                        }\r
                }\r
        case 12:\r
                {\r
                        if (result == 0)\r
                        {\r
-                               result = entry1->last_commit_author.CompareNoCase(entry2->last_commit_author);\r
+//                             result = entry1->last_commit_author.CompareNoCase(entry2->last_commit_author);\r
                        }\r
                }\r
        case 11:\r
@@ -1027,28 +1027,28 @@ bool CGitStatusListCtrl::CSorter::operator()
                {\r
                        if (result == 0)\r
                        {\r
-                               result = entry1->status - entry2->status;\r
+       //                      result = entry1->status - entry2->status;\r
                        }\r
                }\r
        case 2:\r
                {\r
                        if (result == 0)\r
                        {\r
-                               result = entry1->path.GetFileExtension().CompareNoCase(entry2->path.GetFileExtension());\r
+                               result = entry1->GetFileExtension().CompareNoCase(entry2->GetFileExtension());\r
                        }\r
                }\r
        case 1:\r
                {\r
                        if (result == 0)\r
                        {\r
-                               result = entry1->path.GetFileOrDirectoryName().CompareNoCase(entry2->path.GetFileOrDirectoryName());\r
+                               result = entry1->GetFileOrDirectoryName().CompareNoCase(entry2->GetFileOrDirectoryName());\r
                        }\r
                }\r
        case 0:         // path column\r
                {\r
                        if (result == 0)\r
                        {\r
-                               result = CTGitPath::Compare(entry1->path, entry2->path);\r
+                               result = CTGitPath::Compare(entry1->GetGitPathString(), entry2->GetGitPathString());\r
                        }\r
                }\r
        default:\r
index 76e5e32..c4d6ed6 100644 (file)
@@ -25,7 +25,7 @@
 IMPLEMENT_DYNAMIC(CRevisionDlg, CDialog)\r
 CRevisionDlg::CRevisionDlg(CWnd* pParent /*=NULL*/)\r
        : CDialog(CRevisionDlg::IDD, pParent)\r
-       , SVNRev(_T("HEAD"))\r
+       //, GitRev(_T("HEAD"))\r
        , m_bAllowWCRevs(true)\r
 {\r
 }\r
index 4d2c27e..9971bf4 100644 (file)
                        Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;h;hpp;hxx;hm;inl;inc"\r
                        >\r
                        <File\r
+                               RelativePath=".\gitstatuslistctrl.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
                                RelativePath=".\ProjectProperties.cpp"\r
                                >\r
                        </File>\r
index e9db27b..2462ac2 100644 (file)
@@ -11,7 +11,7 @@
                        <DebugSettings\r
                                Command="$(TargetPath)"\r
                                WorkingDirectory="D:\Profiles\b20596\qgit4"\r
-                               CommandArguments="/command:log"\r
+                               CommandArguments="/command:commit"\r
                                Attach="false"\r
                                DebuggerType="3"\r
                                Remote="1"\r
index 27789fe..fd35979 100644 (file)
Binary files a/TortoiseShell/TortoiseShell.suo and b/TortoiseShell/TortoiseShell.suo differ