File indexing completed on 2024-05-12 17:16:25

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 http://kdesvn.alwins-world.de.           *
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 {
0051         UUID_DEFAULT_ACTION = 0,
0052         UUID_IGNORE_ACTION = 1,
0053         UUID_FORCE_ACTION = 2
0054     };
0055     //! constructor
0056     /*!
0057      * \param aListener callback object, the object will NOT take the ownership.
0058      */
0059     explicit Repository(svn::repository::RepositoryListener *aListener);
0060     //! destructor
0061     virtual ~Repository();
0062 
0063     //! open a local repository path for maintenance
0064     /*!
0065         Assigns a repository with that object. If a path was opened before it will closed.
0066         \param path Path to a local repository, must not be an url
0067         \exception ClientException will be thrown in case of an error
0068      */
0069     void Open(const QString &path);
0070     //! Creates and open a new repository
0071     /*!
0072      * Creates a new repository in path with type fstype. If create succeeded open and assigns with the object.
0073      * If a repository was opened before it will closed.
0074      * @param params All values needed
0075      */
0076     void CreateOpen(const CreateRepoParameter &params);
0077     //! dump content of repository to a file
0078     /*!
0079         The repository must opened before. Progress message go trough the assigned svn::repository::RepositoryListener object.
0080         The revision parameter must be numbers, no constant values like svn::Revision::HEAD.
0081         \param output where to output the content
0082         \param start Begin on revision. If revision == -1 than start with first entry.
0083         \param end End with revision.  If revision == -1 than end with current head.
0084         \param incremental dump incrementally
0085         \param use_deltas use deltas in dump output
0086         \exception ClientException will be thrown in case of an error
0087      */
0088     void dump(const QString &output, const svn::Revision &start, const svn::Revision &end, bool incremental, bool use_deltas);
0089     //! load a dump into repository
0090     /*!
0091         The repository must opened before. Progress message go trough the assigned svn::repository::RepositoryListener object.
0092         \param dump Dumpfile to load
0093         \param uuida what to do with UUIDs
0094         \param parentFolder put content of dumpstream within folder in repository, if empty put into root-folder.
0095         \param usePre use pre-commit-hook
0096         \param usePost use post-commit-hook
0097         \param validateProps validate properties (@since subversion 1.7)
0098         \exception ClientException will be thrown in case of an error
0099      */
0100     void loaddump(const QString &dump, LOAD_UUID uuida, const QString &parentFolder, bool usePre, bool usePost, bool validateProps);
0101     //! copy a repository to a new location
0102     /*!
0103         \param src the repository path to copy
0104         \param dest where to copy
0105         \param cleanlogs remove redundand log files from source
0106         \exception ClientException will be thrown in case of an error
0107      */
0108     static void hotcopy(const QString &src, const QString &dest, bool cleanlogs);
0109 
0110 private:
0111     RepositoryData *m_Data;
0112 };
0113 
0114 }
0115 
0116 }
0117 
0118 #endif