1 /***************************************************************************
2  *   Copyright (C) 2005-2009 by Rajko Albrecht                             *
3  *   ral@alwins-world.de                                                   *
4  *                                                                         *
5  *   This program is free software; you can redistribute it and/or modify  *
6  *   it under the terms of the GNU General Public License as published by  *
7  *   the Free Software Foundation; either version 2 of the License, or     *
8  *   (at your option) any later version.                                   *
9  *                                                                         *
10  *   This program is distributed in the hope that it will be useful,       *
11  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
12  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
13  *   GNU General Public License for more details.                          *
14  *                                                                         *
15  *   You should have received a copy of the GNU General Public License     *
16  *   along with this program; if not, write to the                         *
17  *   Free Software Foundation, Inc.,                                       *
18  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
19  ***************************************************************************/
20 #ifndef REVISIONTREE_H
21 #define REVISIONTREE_H
22 
23 #include "svnqt/log_entry.h"
24 #include "svnqt/revision.h"
25 #include "svnqt/client.h"
26 
27 #include <qstring.h>
28 
29 class CContextListener;
30 class RtreeData;
31 class RevTreeWidget;
32 
33 namespace svn
34 {
35 class Client;
36 }
37 
38 /**
39     @author Rajko Albrecht <ral@alwins-world.de>
40 */
41 class RevisionTree final
42 {
43 public:
44     Q_DISABLE_COPY(RevisionTree)
45     RevisionTree(const svn::ClientP &,
46                  CContextListener *aListener,
47                  const QString &reposRoot,
48                  const svn::Revision &startr, const svn::Revision &endr,
49                  const QString &, const svn::Revision &baserevision,
50                  QWidget *parent = nullptr);
51     ~RevisionTree();
52 
53     bool isValid()const;
54     RevTreeWidget *getView();
55 
56 protected:
57     long m_Baserevision;
58     long m_InitialRevsion;
59     QString m_Path;
60     bool m_Valid;
61 
62     RtreeData *m_Data;
63 
64     bool topDownScan();
65     bool bottomUpScan(long startrev, unsigned recurse, const QString &path, long sRev = -1);
66     bool isDeleted(long revision, const QString &);
67 
68     static bool isParent(const QString &_par, const QString &tar);
69 
70     void fillItem(long revIndex, int pathIndex, const QString &nodeName, const QString &path);
71 };
72 
73 #endif
74