2016-01-15 14:57:40 +01:00
|
|
|
/****************************************************************************
|
2009-11-02 18:50:06 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 Brian McGillion
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
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
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2009-11-02 18:50:06 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2010-12-17 16:01:08 +01:00
|
|
|
**
|
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:
|
2015-03-26 12:22:29 +01:00
|
|
|
MercurialClient();
|
2011-06-10 15:27:57 +00:00
|
|
|
|
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);
|
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());
|
2015-11-20 10:39:00 +02:00
|
|
|
|
|
|
|
|
public slots:
|
2011-08-23 10:38:44 +00:00
|
|
|
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;
|
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
|