2009-11-02 18:50:06 +01:00
|
|
|
/**************************************************************************
|
|
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator
|
|
|
|
|
**
|
|
|
|
|
** Copyright (c) 2009 Brian McGillion
|
|
|
|
|
**
|
2011-04-13 08:42:33 +02:00
|
|
|
** Contact: Nokia Corporation (info@qt.nokia.com)
|
2009-11-02 18:50:06 +01:00
|
|
|
**
|
|
|
|
|
**
|
|
|
|
|
** GNU Lesser General Public License Usage
|
|
|
|
|
**
|
2011-04-13 08:42:33 +02:00
|
|
|
** This file may be used under the terms of the GNU Lesser General Public
|
|
|
|
|
** License version 2.1 as published by the Free Software Foundation and
|
|
|
|
|
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
|
|
|
|
** Please review the following information to ensure the GNU Lesser General
|
|
|
|
|
** Public License version 2.1 requirements will be met:
|
|
|
|
|
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
2009-11-02 18:50:06 +01:00
|
|
|
**
|
2010-12-17 16:01:08 +01:00
|
|
|
** In addition, as a special exception, Nokia gives you certain additional
|
2011-04-13 08:42:33 +02:00
|
|
|
** rights. These rights are described in the Nokia Qt LGPL Exception
|
2010-12-17 16:01:08 +01:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
2011-04-13 08:42:33 +02:00
|
|
|
** Other Usage
|
|
|
|
|
**
|
|
|
|
|
** Alternatively, this file may be used in accordance with the terms and
|
|
|
|
|
** conditions contained in a signed written agreement between you and Nokia.
|
|
|
|
|
**
|
2010-12-17 16:01:08 +01:00
|
|
|
** If you have questions regarding the use of this file, please contact
|
2011-05-06 15:05:37 +02:00
|
|
|
** Nokia at info@qt.nokia.com.
|
2009-11-02 18:50:06 +01:00
|
|
|
**
|
|
|
|
|
**************************************************************************/
|
|
|
|
|
|
2009-09-15 13:03:13 +03:00
|
|
|
#ifndef MERCURIALCLIENT_H
|
|
|
|
|
#define MERCURIALCLIENT_H
|
|
|
|
|
|
2011-06-10 15:27:57 +00:00
|
|
|
#include "mercurialsettings.h"
|
2011-02-28 13:40:04 +01:00
|
|
|
#include <vcsbase/vcsbaseclient.h>
|
2010-05-25 12:24:18 +02:00
|
|
|
|
2009-09-15 13:03:13 +03:00
|
|
|
namespace Mercurial {
|
|
|
|
|
namespace Internal {
|
2011-03-28 11:59:26 +02:00
|
|
|
struct MercurialDiffParameters;
|
2009-09-15 13:03:13 +03:00
|
|
|
|
2011-02-28 13:40:04 +01:00
|
|
|
class MercurialClient : public VCSBase::VCSBaseClient
|
2009-09-15 13:03:13 +03:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
2011-06-10 15:27:57 +00:00
|
|
|
MercurialClient(MercurialSettings *settings);
|
|
|
|
|
|
|
|
|
|
MercurialSettings *settings() const;
|
|
|
|
|
|
2011-02-28 13:40:04 +01:00
|
|
|
virtual bool synchronousClone(const QString &workingDir,
|
|
|
|
|
const QString &srcLocation,
|
|
|
|
|
const QString &dstLocation,
|
2011-05-12 14:48:10 +02:00
|
|
|
const QStringList &extraOptions = QStringList());
|
2009-12-08 14:28:00 +01:00
|
|
|
bool manifestSync(const QString &repository, const QString &filename);
|
|
|
|
|
QString branchQuerySync(const QString &repositoryRoot);
|
2010-01-08 09:44:07 +01:00
|
|
|
bool parentRevisionsSync(const QString &workingDirectory,
|
|
|
|
|
const QString &file /* = QString() */,
|
|
|
|
|
const QString &revision,
|
|
|
|
|
QStringList *parents);
|
|
|
|
|
bool shortDescriptionSync(const QString &workingDirectory, const QString &revision,
|
|
|
|
|
const QString &format /* = QString() */, QString *description);
|
|
|
|
|
bool shortDescriptionSync(const QString &workingDirectory, const QString &revision,
|
|
|
|
|
QString *description);
|
|
|
|
|
bool shortDescriptionsSync(const QString &workingDirectory, const QStringList &revisions,
|
|
|
|
|
QStringList *descriptions);
|
2009-12-08 14:28:00 +01:00
|
|
|
void incoming(const QString &repositoryRoot, const QString &repository = QString());
|
|
|
|
|
void outgoing(const QString &repositoryRoot);
|
2010-09-29 12:16:35 +02:00
|
|
|
QString vcsGetRepositoryURL(const QString &directory);
|
2009-09-15 13:03:13 +03:00
|
|
|
|
2011-08-23 10:38:44 +00:00
|
|
|
void annotate(const QString &workingDir, const QString &file,
|
|
|
|
|
const QString revision = QString(), int lineNumber = -1,
|
|
|
|
|
const QStringList &extraOptions = QStringList());
|
|
|
|
|
void commit(const QString &repositoryRoot, const QStringList &files,
|
|
|
|
|
const QString &commitMessageFile,
|
|
|
|
|
const QStringList &extraOptions = QStringList());
|
|
|
|
|
void diff(const QString &workingDir, const QStringList &files = QStringList(),
|
|
|
|
|
const QStringList &extraOptions = QStringList());
|
|
|
|
|
void import(const QString &repositoryRoot, const QStringList &files,
|
|
|
|
|
const QStringList &extraOptions = QStringList());
|
|
|
|
|
void revertAll(const QString &workingDir, const QString &revision = QString(),
|
|
|
|
|
const QStringList &extraOptions = QStringList());
|
|
|
|
|
void view(const QString &source, const QString &id,
|
|
|
|
|
const QStringList &extraOptions = QStringList());
|
|
|
|
|
|
2011-02-28 13:40:04 +01:00
|
|
|
public:
|
2011-04-08 13:53:08 +02:00
|
|
|
QString findTopLevelForFile(const QFileInfo &file) const;
|
2011-02-28 13:40:04 +01:00
|
|
|
|
|
|
|
|
protected:
|
2011-04-08 13:53:08 +02:00
|
|
|
QString vcsEditorKind(VCSCommand cmd) const;
|
2011-08-23 10:38:44 +00:00
|
|
|
QStringList revisionSpec(const QString &revision) const;
|
2011-06-10 15:27:57 +00:00
|
|
|
VCSBase::VCSBaseEditorParameterWidget *createDiffEditor(const QString &workingDir,
|
|
|
|
|
const QStringList &files,
|
|
|
|
|
const QStringList &extraOptions);
|
2011-08-22 15:33:03 +00:00
|
|
|
StatusItem parseStatusLine(const QString &line) const;
|
2009-09-15 13:03:13 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} //namespace Internal
|
|
|
|
|
} //namespace Mercurial
|
|
|
|
|
|
|
|
|
|
#endif // MERCURIALCLIENT_H
|