diff options
author | Friedemann Kleint <[email protected]> | 2010-01-12 16:45:21 +0100 |
---|---|---|
committer | Friedemann Kleint <[email protected]> | 2010-01-12 16:45:21 +0100 |
commit | d5271a086d7be7fbf7b07a2ca450b805b229aa15 (patch) | |
tree | 2ceb1b48a2651455477b03c7ddbf01e50e0151e5 /src/plugins/git/gitversioncontrol.cpp | |
parent | 5ab250fe5705210a422eeaf8c7ef2dd4a8ab4abb (diff) |
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.
Diffstat (limited to 'src/plugins/git/gitversioncontrol.cpp')
-rw-r--r-- | src/plugins/git/gitversioncontrol.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/plugins/git/gitversioncontrol.cpp b/src/plugins/git/gitversioncontrol.cpp index f241396e22d..76541548ccb 100644 --- a/src/plugins/git/gitversioncontrol.cpp +++ b/src/plugins/git/gitversioncontrol.cpp @@ -29,6 +29,7 @@ #include "gitversioncontrol.h" #include "gitclient.h" +#include "gitplugin.h" namespace Git { namespace Internal { @@ -52,6 +53,9 @@ bool GitVersionControl::supportsOperation(Operation operation) const case DeleteOperation: case OpenOperation: break; + case CreateRepositoryOperation: + rc = true; + break; } return rc; } @@ -72,10 +76,14 @@ bool GitVersionControl::vcsDelete(const QString & /*fileName*/) return false; } +bool GitVersionControl::vcsCreateRepository(const QString &directory) +{ + return GitPlugin::instance()->gitClient()->synchronousInit(directory); +} + bool GitVersionControl::managesDirectory(const QString &directory) const { return !GitClient::findRepositoryForDirectory(directory).isEmpty(); - } QString GitVersionControl::findTopLevelForDirectory(const QString &directory) const |