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
47 * \ingroup TortoiseProc
\r
48 * Helper class for the log dialog, handles all the log entries, including
\r
51 class CLogDataVector : public std::vector<GitRev>
\r
54 /// De-allocates log items.
\r
60 int ParserFromLog();
\r
61 int ParserShortLog(CTGitPath *path =NULL,int count = -1 );
\r
62 int FetchFullInfo(int i);
\r
65 int m_FirstFreeLane;
\r
66 MAP_HASH_REV m_HashMap;
\r
67 void updateLanes(GitRev& c, Lanes& lns, CString &sha) ;
\r
68 void setLane(CString& sha) ;
\r
74 /// Ascending date sorting.
\r
77 bool operator()(GitRev& pStart, GitRev& pEnd)
\r
79 return pStart->tmDate < pEnd->tmDate;
\r
82 /// Descending date sorting.
\r
85 bool operator()(GitRev& pStart, GitRev& pEnd)
\r
87 return pStart->tmDate > pEnd->tmDate;
\r
90 /// Ascending revision sorting.
\r
93 bool operator()(GitRev& pStart, GitRev& pEnd)
\r
95 return pStart->Rev < pEnd->Rev;
\r
98 /// Descending revision sorting.
\r
101 bool operator()(GitRev& pStart, GitRev& pEnd)
\r
103 return pStart->Rev > pEnd->Rev;
\r
106 /// Ascending author sorting.
\r
107 struct AscAuthorSort
\r
109 bool operator()(GitRev& pStart, GitRev& pEnd)
\r
111 int ret = pStart->sAuthor.CompareNoCase(pEnd->sAuthor);
\r
113 return pStart->Rev < pEnd->Rev;
\r
117 /// Descending author sorting.
\r
118 struct DescAuthorSort
\r
120 bool operator()(GitRev& pStart, GitRev& pEnd)
\r
122 int ret = pStart->sAuthor.CompareNoCase(pEnd->sAuthor);
\r
124 return pStart->Rev > pEnd->Rev;
\r
128 /// Ascending bugID sorting.
\r
129 struct AscBugIDSort
\r
131 bool operator()(GitRev& pStart, GitRev& pEnd)
\r
133 int ret = pStart->sBugIDs.CompareNoCase(pEnd->sBugIDs);
\r
135 return pStart->Rev < pEnd->Rev;
\r
139 /// Descending bugID sorting.
\r
140 struct DescBugIDSort
\r
142 bool operator()(GitRev& pStart, GitRev& pEnd)
\r
144 int ret = pStart->sBugIDs.CompareNoCase(pEnd->sBugIDs);
\r
146 return pStart->Rev > pEnd->Rev;
\r
150 /// Ascending message sorting.
\r
151 struct AscMessageSort
\r
153 bool operator()(GitRev& pStart, GitRev& pEnd)
\r
155 return pStart->sShortMessage.CompareNoCase(pEnd->sShortMessage)<0;
\r
158 /// Descending message sorting.
\r
159 struct DescMessageSort
\r
161 bool operator()(GitRev& pStart, GitRev& pEnd)
\r
163 return pStart->sShortMessage.CompareNoCase(pEnd->sShortMessage)>0;
\r
166 /// Ascending action sorting
\r
167 struct AscActionSort
\r
169 bool operator() (GitRev& pStart, GitRev& pEnd)
\r
171 if (pStart->actions == pEnd->actions)
\r
172 return pStart->Rev < pEnd->Rev;
\r
173 return pStart->actions < pEnd->actions;
\r
176 /// Descending action sorting
\r
177 struct DescActionSort
\r
179 bool operator() (GitRev& pStart, GitRev& pEnd)
\r
181 if (pStart->actions == pEnd->actions)
\r
182 return pStart->Rev > pEnd->Rev;
\r
183 return pStart->actions > pEnd->actions;
\r