File indexing completed on 2024-04-28 05:42:10

0001 /***************************************************************************
0002  *   Copyright (C) 2006-2009 by Rajko Albrecht                             *
0003  *   ral@alwins-world.de                                                   *
0004  *                                                                         *
0005  * This program is free software; you can redistribute it and/or           *
0006  * modify it under the terms of the GNU Lesser General Public              *
0007  * License as published by the Free Software Foundation; either            *
0008  * version 2.1 of the License, or (at your option) any later version.      *
0009  *                                                                         *
0010  * This program is distributed in the hope that it will be useful,         *
0011  * but WITHOUT ANY WARRANTY; without even the implied warranty of          *
0012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU       *
0013  * Lesser General Public License for more details.                         *
0014  *                                                                         *
0015  * You should have received a copy of the GNU Lesser General Public        *
0016  * License along with this program (in the file LGPL.txt); if not,         *
0017  * write to the Free Software Foundation, Inc., 51 Franklin St,            *
0018  * Fifth Floor, Boston, MA  02110-1301  USA                                *
0019  *                                                                         *
0020  * This software consists of voluntary contributions made by many          *
0021  * individuals.  For exact contribution history, see the revision          *
0022  * history and logs, available at https://commits.kde.org/kdesvn.          *
0023  ***************************************************************************/
0024 #ifndef SVNREPOSITORY_H
0025 #define SVNREPOSITORY_H
0026 
0027 #include <svnqt/exception.h>
0028 #include <svnqt/revision.h>
0029 #include <svnqt/svnqt_defines.h>
0030 
0031 #include <QString>
0032 
0033 namespace svn
0034 {
0035 
0036 namespace repository
0037 {
0038 
0039 class RepositoryData;
0040 class RepositoryListener;
0041 class CreateRepoParameter;
0042 
0043 //! wrapper class for subversions administrative repository functions
0044 /*!
0045     \author Rajko Albrecht <ral@alwins-world.de>
0046 */
0047 class SVNQT_EXPORT Repository
0048 {
0049 public:
0050     enum LOAD_UUID { UUID_DEFAULT_ACTION = 0, UUID_IGNORE_ACTION = 1, UUID_FORCE_ACTION = 2 };
0051     //! constructor
0052     /*!
0053      * \param aListener callback object, the object will NOT take the ownership.
0054      */
0055     explicit Repository(svn::repository::RepositoryListener *aListener);
0056     //! destructor
0057     virtual ~Repository();
0058 
0059     //! open a local repository path for maintenance
0060     /*!
0061         Assigns a repository with that object. If a path was opened before it will closed.
0062         \param path Path to a local repository, must not be an url
0063         \exception ClientException will be thrown in case of an error
0064      */
0065     void Open(const QString &path);
0066     //! Creates and open a new repository
0067     /*!
0068      * Creates a new repository in path with type fstype. If create succeeded open and assigns with the object.
0069      * If a repository was opened before it will closed.
0070      * @param params All values needed
0071      */
0072     void CreateOpen(const CreateRepoParameter &params);
0073     //! dump content of repository to a file
0074     /*!
0075         The repository must opened before. Progress message go trough the assigned svn::repository::RepositoryListener object.
0076         The revision parameter must be numbers, no constant values like svn::Revision::HEAD.
0077         \param output where to output the content
0078         \param start Begin on revision. If revision == -1 than start with first entry.
0079         \param end End with revision.  If revision == -1 than end with current head.
0080         \param incremental dump incrementally
0081         \param use_deltas use deltas in dump output
0082         \exception ClientException will be thrown in case of an error
0083      */
0084     void dump(const QString &output, const svn::Revision &start, const svn::Revision &end, bool incremental, bool use_deltas);
0085     //! load a dump into repository
0086     /*!
0087         The repository must opened before. Progress message go trough the assigned svn::repository::RepositoryListener object.
0088         \param dump Dumpfile to load
0089         \param uuida what to do with UUIDs
0090         \param parentFolder put content of dumpstream within folder in repository, if empty put into root-folder.
0091         \param usePre use pre-commit-hook
0092         \param usePost use post-commit-hook
0093         \param validateProps validate properties (@since subversion 1.7)
0094         \exception ClientException will be thrown in case of an error
0095      */
0096     void loaddump(const QString &dump, LOAD_UUID uuida, const QString &parentFolder, bool usePre, bool usePost, bool validateProps);
0097     //! copy a repository to a new location
0098     /*!
0099         \param src the repository path to copy
0100         \param dest where to copy
0101         \param cleanlogs remove redundand log files from source
0102         \exception ClientException will be thrown in case of an error
0103      */
0104     static void hotcopy(const QString &src, const QString &dest, bool cleanlogs);
0105 
0106 private:
0107     RepositoryData *m_Data;
0108 };
0109 
0110 }
0111 
0112 }
0113 
0114 #endif