forked from qt-creator/qt-creator
VCS[git]: Add support for stashes.
Add non-modal stash management dialog and additional menu option "Stash snapshot..." to stash away changes prompting for a description, which will immediately replay the stash (take snapshot and continue working). Add interface to IVersionControl for creating/restoring/deleting snapshots for backup/complex undo operations (currently supported by git only). Add test options to VCSBasePlugin. Clean up and extend git client accordingly.
This commit is contained in:
@@ -41,8 +41,11 @@ class CORE_EXPORT IVersionControl : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum Operation { AddOperation, DeleteOperation, OpenOperation,
|
||||
CreateRepositoryOperation };
|
||||
enum Operation {
|
||||
AddOperation, DeleteOperation, OpenOperation,
|
||||
CreateRepositoryOperation,
|
||||
SnapshotOperations
|
||||
};
|
||||
|
||||
explicit IVersionControl(QObject *parent = 0) : QObject(parent) {}
|
||||
virtual ~IVersionControl() {}
|
||||
@@ -98,10 +101,31 @@ public:
|
||||
virtual bool vcsDelete(const QString &filename) = 0;
|
||||
|
||||
/*!
|
||||
* Called to initialize the version control systemin a directory.
|
||||
* Called to initialize the version control system in a directory.
|
||||
*/
|
||||
virtual bool vcsCreateRepository(const QString &directory) = 0;
|
||||
|
||||
/*!
|
||||
* Create a snapshot of the current state and return an identifier or
|
||||
* an empty string in case of failure.
|
||||
*/
|
||||
virtual QString vcsCreateSnapshot(const QString &topLevel) = 0;
|
||||
|
||||
/*!
|
||||
* List snapshots.
|
||||
*/
|
||||
virtual QStringList vcsSnapshots(const QString &topLevel) = 0;
|
||||
|
||||
/*!
|
||||
* Restore a snapshot.
|
||||
*/
|
||||
virtual bool vcsRestoreSnapshot(const QString &topLevel, const QString &name) = 0;
|
||||
|
||||
/*!
|
||||
* Remove a snapshot.
|
||||
*/
|
||||
virtual bool vcsRemoveSnapshot(const QString &topLevel, const QString &name) = 0;
|
||||
|
||||
signals:
|
||||
void repositoryChanged(const QString &repository);
|
||||
void filesChanged(const QStringList &files);
|
||||
|
||||
Reference in New Issue
Block a user