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
30 * \ingroup TortoiseProc
\r
31 * Instances of CStoreSelection save the selection of the CLogDlg. When the instance
\r
32 * is deleted the destructor restores the selection.
\r
34 typedef std::map<CString, int> MAP_HASH_REV;
\r
36 class CStoreSelection
\r
39 CStoreSelection(CLogDlg* dlg);
\r
43 std::set<LONG> m_SetSelectedRevisions;
\r
48 * \ingroup TortoiseProc
\r
49 * Helper class for the log dialog, handles all the log entries, including
\r
52 class CLogDataVector : public std::vector<GitRev>
\r
55 /// De-allocates log items.
\r
61 int ParserFromLog(CTGitPath *path =NULL,int count = -1,int infomask=CGit::LOG_INFO_STAT|CGit::LOG_INFO_FILESTATE);
\r
62 int ParserShortLog(CTGitPath *path ,CString &hash,int count=-1 ,int mask=CGit::LOG_INFO_ONLY_HASH );
\r
63 int FetchFullInfo(int i);
\r
66 int m_FirstFreeLane;
\r
67 MAP_HASH_REV m_HashMap;
\r
68 void updateLanes(GitRev& c, Lanes& lns, CString &sha) ;
\r
69 void setLane(CString& sha) ;
\r
75 /// Ascending date sorting.
\r
78 bool operator()(GitRev& pStart, GitRev& pEnd)
\r
80 return pStart->tmDate < pEnd->tmDate;
\r
83 /// Descending date sorting.
\r
86 bool operator()(GitRev& pStart, GitRev& pEnd)
\r
88 return pStart->tmDate > pEnd->tmDate;
\r
91 /// Ascending revision sorting.
\r
94 bool operator()(GitRev& pStart, GitRev& pEnd)
\r
96 return pStart->Rev < pEnd->Rev;
\r
99 /// Descending revision sorting.
\r
102 bool operator()(GitRev& pStart, GitRev& pEnd)
\r
104 return pStart->Rev > pEnd->Rev;
\r
107 /// Ascending author sorting.
\r
108 struct AscAuthorSort
\r
110 bool operator()(GitRev& pStart, GitRev& pEnd)
\r
112 int ret = pStart->sAuthor.CompareNoCase(pEnd->sAuthor);
\r
114 return pStart->Rev < pEnd->Rev;
\r
118 /// Descending author sorting.
\r
119 struct DescAuthorSort
\r
121 bool operator()(GitRev& pStart, GitRev& pEnd)
\r
123 int ret = pStart->sAuthor.CompareNoCase(pEnd->sAuthor);
\r
125 return pStart->Rev > pEnd->Rev;
\r
129 /// Ascending bugID sorting.
\r
130 struct AscBugIDSort
\r
132 bool operator()(GitRev& pStart, GitRev& pEnd)
\r
134 int ret = pStart->sBugIDs.CompareNoCase(pEnd->sBugIDs);
\r
136 return pStart->Rev < pEnd->Rev;
\r
140 /// Descending bugID sorting.
\r
141 struct DescBugIDSort
\r
143 bool operator()(GitRev& pStart, GitRev& pEnd)
\r
145 int ret = pStart->sBugIDs.CompareNoCase(pEnd->sBugIDs);
\r
147 return pStart->Rev > pEnd->Rev;
\r
151 /// Ascending message sorting.
\r
152 struct AscMessageSort
\r
154 bool operator()(GitRev& pStart, GitRev& pEnd)
\r
156 return pStart->sShortMessage.CompareNoCase(pEnd->sShortMessage)<0;
\r
159 /// Descending message sorting.
\r
160 struct DescMessageSort
\r
162 bool operator()(GitRev& pStart, GitRev& pEnd)
\r
164 return pStart->sShortMessage.CompareNoCase(pEnd->sShortMessage)>0;
\r
167 /// Ascending action sorting
\r
168 struct AscActionSort
\r
170 bool operator() (GitRev& pStart, GitRev& pEnd)
\r
172 if (pStart->actions == pEnd->actions)
\r
173 return pStart->Rev < pEnd->Rev;
\r
174 return pStart->actions < pEnd->actions;
\r
177 /// Descending action sorting
\r
178 struct DescActionSort
\r
180 bool operator() (GitRev& pStart, GitRev& pEnd)
\r
182 if (pStart->actions == pEnd->actions)
\r
183 return pStart->Rev > pEnd->Rev;
\r
184 return pStart->actions > pEnd->actions;
\r