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)
|
|
|
|
|
**
|
|
|
|
|
** Commercial Usage
|
|
|
|
|
**
|
|
|
|
|
** Licensees holding valid Qt Commercial licenses may use this file in
|
|
|
|
|
** accordance with the Qt Commercial License Agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
|
|
|
** a written agreement between you and Nokia.
|
|
|
|
|
**
|
|
|
|
|
** 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.
|
|
|
|
|
**
|
|
|
|
|
** If you are unsure which license is appropriate for your use, please
|
|
|
|
|
** contact the sales department at http://qt.nokia.com/contact.
|
|
|
|
|
**
|
|
|
|
|
**************************************************************************/
|
|
|
|
|
|
2009-09-15 13:03:13 +03:00
|
|
|
#ifndef MERCURIALCONTROL_H
|
|
|
|
|
#define MERCURIALCONTROL_H
|
|
|
|
|
|
|
|
|
|
#include <coreplugin/iversioncontrol.h>
|
|
|
|
|
|
2009-12-04 12:58:01 +01:00
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
class QVariant;
|
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
2009-09-15 13:03:13 +03:00
|
|
|
namespace Mercurial {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
|
|
|
|
class MercurialClient;
|
|
|
|
|
|
|
|
|
|
//Implements just the basics of the Version Control Interface
|
|
|
|
|
//MercurialClient handles all the work
|
|
|
|
|
class MercurialControl: public Core::IVersionControl
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
|
|
|
|
explicit MercurialControl(MercurialClient *mercurialClient);
|
|
|
|
|
|
2010-01-07 18:17:24 +01:00
|
|
|
QString displayName() const;
|
2010-05-20 16:24:39 +02:00
|
|
|
bool managesDirectory(const QString &filename, QString *topLevel = 0) const;
|
2009-09-15 13:03:13 +03:00
|
|
|
bool supportsOperation(Operation operation) const;
|
|
|
|
|
bool vcsOpen(const QString &fileName);
|
|
|
|
|
bool vcsAdd(const QString &filename);
|
|
|
|
|
bool vcsDelete(const QString &filename);
|
2010-05-11 14:13:38 +02:00
|
|
|
bool vcsMove(const QString &from, const QString &to);
|
2010-01-12 16:45:21 +01:00
|
|
|
bool vcsCreateRepository(const QString &directory);
|
2010-09-29 12:16:35 +02:00
|
|
|
bool vcsCheckout(const QString &directory, const QByteArray &url);
|
|
|
|
|
QString vcsGetRepositoryURL(const QString &directory);
|
2010-01-15 12:24:06 +01:00
|
|
|
QString vcsCreateSnapshot(const QString &topLevel);
|
|
|
|
|
QStringList vcsSnapshots(const QString &topLevel);
|
|
|
|
|
bool vcsRestoreSnapshot(const QString &topLevel, const QString &name);
|
|
|
|
|
bool vcsRemoveSnapshot(const QString &topLevel, const QString &name);
|
2009-09-15 13:03:13 +03:00
|
|
|
bool sccManaged(const QString &filename);
|
2010-03-19 17:22:18 +01:00
|
|
|
virtual bool vcsAnnotate(const QString &file, int line);
|
2009-09-15 13:03:13 +03:00
|
|
|
|
2009-12-04 12:58:01 +01:00
|
|
|
public slots:
|
|
|
|
|
// To be connected to the HgTask's success signal to emit the repository/
|
|
|
|
|
// files changed signals according to the variant's type:
|
|
|
|
|
// String -> repository, StringList -> files
|
|
|
|
|
void changed(const QVariant&);
|
|
|
|
|
|
2009-09-15 13:03:13 +03:00
|
|
|
private:
|
|
|
|
|
MercurialClient *mercurialClient;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} //namespace Internal
|
|
|
|
|
} //namespace Mercurial
|
|
|
|
|
|
|
|
|
|
#endif // MERCURIALCONTROL_H
|