2009-11-02 18:50:06 +01:00
|
|
|
/**************************************************************************
|
|
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator
|
|
|
|
|
**
|
|
|
|
|
** Copyright (c) 2009 Brian McGillion
|
|
|
|
|
**
|
|
|
|
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
|
|
|
|
**
|
2010-12-17 16:01:08 +01:00
|
|
|
** No Commercial Usage
|
2009-11-02 18:50:06 +01:00
|
|
|
**
|
2010-12-17 16:01:08 +01:00
|
|
|
** This file contains pre-release code and may not be distributed.
|
|
|
|
|
** You may use this file in accordance with the terms and conditions
|
|
|
|
|
** contained in the Technology Preview License Agreement accompanying
|
|
|
|
|
** this package.
|
2009-11-02 18:50:06 +01:00
|
|
|
**
|
|
|
|
|
** GNU Lesser General Public License Usage
|
|
|
|
|
**
|
|
|
|
|
** Alternatively, 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.
|
|
|
|
|
**
|
2010-12-17 16:01:08 +01:00
|
|
|
** In addition, as a special exception, Nokia gives you certain additional
|
|
|
|
|
** rights. These rights are described in the Nokia Qt LGPL Exception
|
|
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
|
|
|
|
** If you have questions regarding the use of this file, please contact
|
|
|
|
|
** Nokia at qt-info@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-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-02-28 13:40:04 +01:00
|
|
|
class MercurialClient : public VCSBase::VCSBaseClient
|
2009-09-15 13:03:13 +03:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
2011-02-28 13:40:04 +01:00
|
|
|
enum ExtraOptionId
|
|
|
|
|
{
|
|
|
|
|
// Commit
|
|
|
|
|
AuthorCommitOptionId,
|
|
|
|
|
AutoAddRemoveCommitOptionId
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
MercurialClient(const VCSBase::VCSBaseClientSettings &settings);
|
|
|
|
|
virtual bool synchronousClone(const QString &workingDir,
|
|
|
|
|
const QString &srcLocation,
|
|
|
|
|
const QString &dstLocation,
|
|
|
|
|
const ExtraCommandOptions &extraOptions = ExtraCommandOptions());
|
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-02-28 13:40:04 +01:00
|
|
|
public:
|
|
|
|
|
virtual QString findTopLevelForFile(const QFileInfo &file) const;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
virtual QString vcsEditorKind(VCSCommand cmd) const;
|
|
|
|
|
|
|
|
|
|
virtual QStringList cloneArguments(const QString &srcLocation,
|
|
|
|
|
const QString &dstLocation,
|
|
|
|
|
const ExtraCommandOptions &extraOptions) const;
|
|
|
|
|
virtual QStringList pullArguments(const QString &srcLocation,
|
|
|
|
|
const ExtraCommandOptions &extraOptions) const;
|
|
|
|
|
virtual QStringList pushArguments(const QString &dstLocation,
|
|
|
|
|
const ExtraCommandOptions &extraOptions) const;
|
|
|
|
|
virtual QStringList commitArguments(const QStringList &files,
|
|
|
|
|
const QString &commitMessageFile,
|
|
|
|
|
const ExtraCommandOptions &extraOptions) const;
|
|
|
|
|
virtual QStringList importArguments(const QStringList &files) const;
|
|
|
|
|
virtual QStringList updateArguments(const QString &revision) const;
|
|
|
|
|
virtual QStringList revertArguments(const QString &file, const QString &revision) const;
|
|
|
|
|
virtual QStringList revertAllArguments(const QString &revision) const;
|
|
|
|
|
virtual QStringList annotateArguments(const QString &file,
|
|
|
|
|
const QString &revision, int lineNumber) const;
|
|
|
|
|
virtual QStringList diffArguments(const QStringList &files) const;
|
|
|
|
|
virtual QStringList logArguments(const QStringList &files) const;
|
|
|
|
|
virtual QStringList statusArguments(const QString &file) const;
|
|
|
|
|
virtual QStringList viewArguments(const QString &revision) const;
|
|
|
|
|
|
|
|
|
|
virtual QPair<QString, QString> parseStatusLine(const QString &line) const;
|
2009-09-15 13:03:13 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} //namespace Internal
|
|
|
|
|
} //namespace Mercurial
|
|
|
|
|
|
|
|
|
|
#endif // MERCURIALCLIENT_H
|