forked from qt-creator/qt-creator
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:
@@ -62,17 +62,15 @@ QString MercurialControl::findTopLevelForDirectory(const QString &directory) con
|
||||
bool MercurialControl::supportsOperation(Operation operation) const
|
||||
{
|
||||
bool supported = true;
|
||||
|
||||
switch (operation) {
|
||||
case Core::IVersionControl::AddOperation:
|
||||
case Core::IVersionControl::DeleteOperation:
|
||||
case Core::IVersionControl::CreateRepositoryOperation:
|
||||
break;
|
||||
case Core::IVersionControl::OpenOperation:
|
||||
default:
|
||||
supported = false;
|
||||
break;
|
||||
}
|
||||
|
||||
return supported;
|
||||
}
|
||||
|
||||
@@ -94,6 +92,11 @@ bool MercurialControl::vcsDelete(const QString &filename)
|
||||
return mercurialClient->remove(fi.absolutePath(), fi.fileName());
|
||||
}
|
||||
|
||||
bool MercurialControl::vcsCreateRepository(const QString &directory)
|
||||
{
|
||||
return mercurialClient->createRepositorySync(directory);
|
||||
}
|
||||
|
||||
bool MercurialControl::sccManaged(const QString &filename)
|
||||
{
|
||||
const QFileInfo fi(filename);
|
||||
|
||||
Reference in New Issue
Block a user