1 // TortoiseGit - a Windows shell extension for easy version control
\r
3 // Copyright (C) 2003-2007 - TortoiseGit
\r
5 // This program is free software; you can redistribute it and/or
\r
6 // modify it under the terms of the GNU General Public License
\r
7 // as published by the Free Software Foundation; either version 2
\r
8 // of the License, or (at your option) any later version.
\r
10 // This program is distributed in the hope that it will be useful,
\r
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 // GNU General Public License for more details.
\r
15 // You should have received a copy of the GNU General Public License
\r
16 // along with this program; if not, write to the Free Software Foundation,
\r
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
\r
22 #include "GitStatus.h"
\r
23 #include "ILogReceiver.h"
\r
29 * \ingroup TortoiseProc
\r
30 * Instances of CStoreSelection save the selection of the CLogDlg. When the instance
\r
31 * is deleted the destructor restores the selection.
\r
33 typedef std::map<CString, int> MAP_HASH_REV;
\r
35 class CStoreSelection
\r
38 CStoreSelection(CLogDlg* dlg);
\r
42 std::set<LONG> m_SetSelectedRevisions;
\r
46 * \ingroup TortoiseProc
\r
47 * Contains the data of one log entry, used in the log dialog
\r
50 typedef struct LogEntryData
\r
57 CString sShortMessage;
\r
59 DWORD dwFileChanges;
\r
60 LogChangedPathArray* pArChangedPaths;
\r
65 DWORD childStackDepth;
\r
66 } LOGENTRYDATA, *PLOGENTRYDATA;
\r
69 * \ingroup TortoiseProc
\r
70 * Helper class for the log dialog, handles all the log entries, including
\r
73 class CLogDataVector : public std::vector<GitRev>
\r
76 /// De-allocates log items.
\r
82 int ParserFromLog();
\r
83 int ParserShortLog();
\r
84 int FetchFullInfo(int i);
\r
87 int m_FirstFreeLane;
\r
88 MAP_HASH_REV m_HashMap;
\r
89 void updateLanes(GitRev& c, Lanes& lns, CString &sha) ;
\r
90 void setLane(CString& sha) ;
\r
96 /// Ascending date sorting.
\r
99 bool operator()(GitRev& pStart, GitRev& pEnd)
\r
101 return pStart->tmDate < pEnd->tmDate;
\r
104 /// Descending date sorting.
\r
105 struct DescDateSort
\r
107 bool operator()(GitRev& pStart, GitRev& pEnd)
\r
109 return pStart->tmDate > pEnd->tmDate;
\r
112 /// Ascending revision sorting.
\r
115 bool operator()(GitRev& pStart, GitRev& pEnd)
\r
117 return pStart->Rev < pEnd->Rev;
\r
120 /// Descending revision sorting.
\r
123 bool operator()(GitRev& pStart, GitRev& pEnd)
\r
125 return pStart->Rev > pEnd->Rev;
\r
128 /// Ascending author sorting.
\r
129 struct AscAuthorSort
\r
131 bool operator()(GitRev& pStart, GitRev& pEnd)
\r
133 int ret = pStart->sAuthor.CompareNoCase(pEnd->sAuthor);
\r
135 return pStart->Rev < pEnd->Rev;
\r
139 /// Descending author sorting.
\r
140 struct DescAuthorSort
\r
142 bool operator()(GitRev& pStart, GitRev& pEnd)
\r
144 int ret = pStart->sAuthor.CompareNoCase(pEnd->sAuthor);
\r
146 return pStart->Rev > pEnd->Rev;
\r
150 /// Ascending bugID sorting.
\r
151 struct AscBugIDSort
\r
153 bool operator()(GitRev& pStart, GitRev& pEnd)
\r
155 int ret = pStart->sBugIDs.CompareNoCase(pEnd->sBugIDs);
\r
157 return pStart->Rev < pEnd->Rev;
\r
161 /// Descending bugID sorting.
\r
162 struct DescBugIDSort
\r
164 bool operator()(GitRev& pStart, GitRev& pEnd)
\r
166 int ret = pStart->sBugIDs.CompareNoCase(pEnd->sBugIDs);
\r
168 return pStart->Rev > pEnd->Rev;
\r
172 /// Ascending message sorting.
\r
173 struct AscMessageSort
\r
175 bool operator()(GitRev& pStart, GitRev& pEnd)
\r
177 return pStart->sShortMessage.CompareNoCase(pEnd->sShortMessage)<0;
\r
180 /// Descending message sorting.
\r
181 struct DescMessageSort
\r
183 bool operator()(GitRev& pStart, GitRev& pEnd)
\r
185 return pStart->sShortMessage.CompareNoCase(pEnd->sShortMessage)>0;
\r
188 /// Ascending action sorting
\r
189 struct AscActionSort
\r
191 bool operator() (GitRev& pStart, GitRev& pEnd)
\r
193 if (pStart->actions == pEnd->actions)
\r
194 return pStart->Rev < pEnd->Rev;
\r
195 return pStart->actions < pEnd->actions;
\r
198 /// Descending action sorting
\r
199 struct DescActionSort
\r
201 bool operator() (GitRev& pStart, GitRev& pEnd)
\r
203 if (pStart->actions == pEnd->actions)
\r
204 return pStart->Rev > pEnd->Rev;
\r
205 return pStart->actions > pEnd->actions;
\r