2009-11-02 18:50:06 +01:00
|
|
|
/**************************************************************************
|
|
|
|
|
**
|
2014-01-07 13:27:11 +01:00
|
|
|
** Copyright (c) 2014 Brian McGillion
|
2012-10-02 09:12:39 +02:00
|
|
|
** Contact: http://www.qt-project.org/legal
|
2009-11-02 18:50:06 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2009-11-02 18:50:06 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
|
|
|
** a written agreement between you and Digia. For licensing terms and
|
2014-10-01 13:21:18 +02:00
|
|
|
** conditions see http://www.qt.io/licensing. For further information
|
|
|
|
|
** use the contact form at http://www.qt.io/contact-us.
|
2009-11-02 18:50:06 +01:00
|
|
|
**
|
|
|
|
|
** GNU Lesser General Public License Usage
|
2012-10-02 09:12:39 +02:00
|
|
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
2014-10-01 13:21:18 +02:00
|
|
|
** General Public License version 2.1 or version 3 as published by the Free
|
|
|
|
|
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
|
|
|
|
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
|
|
|
|
** following information to ensure the GNU Lesser General Public License
|
|
|
|
|
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
|
|
|
|
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
2012-10-02 09:12:39 +02:00
|
|
|
**
|
|
|
|
|
** In addition, as a special exception, Digia gives you certain additional
|
|
|
|
|
** rights. These rights are described in the Digia Qt LGPL Exception
|
2010-12-17 16:01:08 +01:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
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
|
|
|
|
2012-01-07 12:31:48 +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;
|
|
|
|
|
|
2013-01-17 21:51:27 +02:00
|
|
|
bool synchronousClone(const QString &workingDir,
|
|
|
|
|
const QString &srcLocation,
|
|
|
|
|
const QString &dstLocation,
|
|
|
|
|
const QStringList &extraOptions = QStringList());
|
2013-07-10 21:55:52 +03:00
|
|
|
bool synchronousPull(const QString &workingDir,
|
|
|
|
|
const QString &srcLocation,
|
|
|
|
|
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);
|
2012-06-04 12:15:54 +03:00
|
|
|
QStringList parentRevisionsSync(const QString &workingDirectory,
|
2010-01-08 09:44:07 +01:00
|
|
|
const QString &file /* = QString() */,
|
2012-06-04 12:15:54 +03:00
|
|
|
const QString &revision);
|
|
|
|
|
QString shortDescriptionSync(const QString &workingDirectory, const QString &revision,
|
|
|
|
|
const QString &format /* = QString() */);
|
|
|
|
|
QString shortDescriptionSync(const QString &workingDirectory, const QString &revision);
|
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);
|
2013-10-02 00:18:39 +03:00
|
|
|
bool managesFile(const QString &workingDirectory, const QString &fileName) const;
|
2009-09-15 13:03:13 +03:00
|
|
|
|
2011-08-23 10:38:44 +00:00
|
|
|
void annotate(const QString &workingDir, const QString &file,
|
2014-05-05 16:59:56 +03:00
|
|
|
const QString &revision = QString(), int lineNumber = -1,
|
2011-08-23 10:38:44 +00:00
|
|
|
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:
|
2014-08-27 18:55:41 +02:00
|
|
|
Core::Id vcsEditorKind(VcsCommandTag cmd) const;
|
2011-08-23 10:38:44 +00:00
|
|
|
QStringList revisionSpec(const QString &revision) const;
|
2012-01-07 12:31:48 +01:00
|
|
|
VcsBase::VcsBaseEditorParameterWidget *createDiffEditor(const QString &workingDir,
|
2011-06-10 15:27:57 +00:00
|
|
|
const QStringList &files,
|
|
|
|
|
const QStringList &extraOptions);
|
2011-08-22 15:33:03 +00:00
|
|
|
StatusItem parseStatusLine(const QString &line) const;
|
2013-07-10 21:55:52 +03:00
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
void needUpdate();
|
|
|
|
|
void needMerge();
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
void parsePullOutput(const QString &output);
|
2009-09-15 13:03:13 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} //namespace Internal
|
|
|
|
|
} //namespace Mercurial
|
|
|
|
|
|
|
|
|
|
#endif // MERCURIALCLIENT_H
|