VCS[hg, git]: Add support for repository creation.

Add repository creation operation to IVersionControl, implement for hg
and git, add convenience slot with prompts to VCSBasePlugin.
Add respective menu options and make menus are visible in case no VCS is
active.
Change project wizards extension page to list VCS that are capable of
repository creation in a QComboBox in case the directory is not managed
by another VCS (in which case it lists that one for operation 'add').
On that occasion, polish the Project selection to use a QComboBox as
well and add some smartness to find the most suitable project to add via
path matching.
This commit is contained in:
Friedemann Kleint
2010-01-12 16:45:21 +01:00
parent 5ab250fe57
commit d5271a086d
30 changed files with 454 additions and 188 deletions

View File

@@ -41,9 +41,10 @@ class CORE_EXPORT IVersionControl : public QObject
{
Q_OBJECT
public:
enum Operation { AddOperation, DeleteOperation, OpenOperation };
enum Operation { AddOperation, DeleteOperation, OpenOperation,
CreateRepositoryOperation };
IVersionControl(QObject *parent = 0) : QObject(parent) {}
explicit IVersionControl(QObject *parent = 0) : QObject(parent) {}
virtual ~IVersionControl() {}
virtual QString displayName() const = 0;
@@ -93,12 +94,14 @@ public:
/*!
* Called after a file has been removed from the project (if the user
* wants), e.g. 'p4 delete', 'svn delete'.
*
* You probably want to call VcsManager::showDeleteDialog, which asks the
* user to confirm the deletion.
*/
virtual bool vcsDelete(const QString &filename) = 0;
/*!
* Called to initialize the version control systemin a directory.
*/
virtual bool vcsCreateRepository(const QString &directory) = 0;
signals:
void repositoryChanged(const QString &repository);
void filesChanged(const QStringList &files);