1 // TortoiseSVN - a Windows shell extension for easy version control
\r
3 // Copyright (C) 2003-2008 - TortoiseSVN
\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 "SVNPrompt.h"
\r
23 #include "SVNLogQuery.h"
\r
24 #include "CacheLogQuery.h"
\r
26 class CFullGraphNode;
\r
29 * \ingroup TortoiseProc
\r
30 * helper struct containing information about a copy operation in the revision graph
\r
36 revision_t fromRevision;
\r
37 index_t fromPathIndex;
\r
38 revision_t toRevision;
\r
39 index_t toPathIndex;
\r
43 CFullGraphNode* source;
\r
44 CDictionaryBasedTempPath path;
\r
46 STarget ( CFullGraphNode* source
\r
47 , const CDictionaryBasedTempPath& path)
\r
54 std::vector<STarget> targets;
\r
56 static SCopyInfo* Create (boost::pool<>& copyInfoPool)
\r
58 SCopyInfo* result = static_cast<SCopyInfo*>(copyInfoPool.malloc());
\r
59 new (result) SCopyInfo();
\r
63 void Destroy (boost::pool<>& copyInfoPool)
\r
66 copyInfoPool.free (this);
\r
71 * \ingroup TortoiseProc
\r
72 * Handles and analyzes log data to produce a revision graph.
\r
74 * Since Subversion only stores information where each entry is copied \b from
\r
75 * and not where it is copied \b to, the first thing we do here is crawl all
\r
76 * revisions and create separate CRevisionEntry objects where we store the
\r
77 * information where those are copied \b to.
\r
79 * In a next step, we go again through all the CRevisionEntry objects to find
\r
80 * out if they are related to the path we're looking at. If they are, we mark
\r
81 * them as \b in-use.
\r
83 class CFullHistory : private ILogReceiver
\r
87 /// construction / destruction
\r
90 ~CFullHistory(void);
\r
94 bool FetchRevisionData (CString path, SVNRev pegRev, bool showWCRev, CProgressDlg* progress);
\r
98 CString GetLastErrorMessage() const;
\r
100 svn_revnum_t GetHeadRevision() const {return headRevision;}
\r
101 svn_revnum_t GetPegRevision() const {return pegRevision;}
\r
102 CString GetRepositoryRoot() const {return CString (repoRoot);}
\r
103 CString GetRepositoryUUID() const {return uuid;}
\r
104 CString GetRelativePath() const {return CString (relPath);}
\r
106 const CDictionaryBasedTempPath* GetStartPath() const {return startPath.get();}
\r
107 revision_t GetStartRevision() const {return startRevision;}
\r
109 const CDictionaryBasedTempPath* GetWCPath() const {return wcPath.get();}
\r
110 revision_t GetWCRevision() const {return wcRevision;}
\r
112 SCopyInfo** GetFirstCopyFrom() const {return copyFromRelation;}
\r
113 SCopyInfo** GetFirstCopyTo() const {return copyToRelation;}
\r
114 void GetCopyFromRange (SCopyInfo**& first, SCopyInfo**& last, revision_t revision) const;
\r
115 void GetCopyToRange (SCopyInfo**& first, SCopyInfo**& last, revision_t revision) const;
\r
117 SVN& GetSVN() {return svn;}
\r
118 const CCachedLogInfo* GetCache() const {return cache;}
\r
124 CProgressDlg* progress;
\r
129 revision_t headRevision;
\r
130 revision_t pegRevision;
\r
132 svn_client_ctx_t ctx;
\r
136 svn_error_t * Err; ///< Global error object struct
\r
137 apr_pool_t * parentpool;
\r
138 apr_pool_t * pool; ///< memory pool
\r
142 const CCachedLogInfo* cache;
\r
143 std::auto_ptr<CSVNLogQuery> svnQuery;
\r
144 std::auto_ptr<CCacheLogQuery> query;
\r
146 std::auto_ptr<CDictionaryBasedTempPath> startPath;
\r
147 revision_t startRevision;
\r
149 std::auto_ptr<CDictionaryBasedTempPath> wcPath;
\r
150 revision_t wcRevision;
\r
152 boost::pool<> copyInfoPool;
\r
153 std::vector<SCopyInfo*> copiesContainer;
\r
154 SCopyInfo** copyToRelation;
\r
155 SCopyInfo** copyToRelationEnd;
\r
156 SCopyInfo** copyFromRelation;
\r
157 SCopyInfo** copyFromRelationEnd;
\r
161 static svn_error_t* cancel(void *baton);
\r
163 /// utility methods
\r
165 void ClearCopyInfo();
\r
166 void AnalyzeRevisionData();
\r
167 void BuildForwardCopies();
\r
169 /// implement ILogReceiver
\r
171 void ReceiveLog ( LogChangedPathArray* changes
\r
173 , const StandardRevProps* stdRevProps
\r
174 , UserRevPropArray* userRevProps
\r
175 , bool mergesFollow);
\r