forked from qt-creator/qt-creator
Move createInitialCheckoutCommand() out from core plugin
Change-Id: I99f4795822838ac084d0d6823db96e5864e0dcdf Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -88,18 +88,6 @@ FilePaths IVersionControl::additionalToolsPath() const
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
VcsBase::VcsCommand *IVersionControl::createInitialCheckoutCommand(const QString &url,
|
|
||||||
const Utils::FilePath &baseDirectory,
|
|
||||||
const QString &localName,
|
|
||||||
const QStringList &extraArgs)
|
|
||||||
{
|
|
||||||
Q_UNUSED(url)
|
|
||||||
Q_UNUSED(baseDirectory)
|
|
||||||
Q_UNUSED(localName)
|
|
||||||
Q_UNUSED(extraArgs)
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
IVersionControl::RepoUrl::RepoUrl(const QString &location)
|
IVersionControl::RepoUrl::RepoUrl(const QString &location)
|
||||||
{
|
{
|
||||||
if (location.isEmpty())
|
if (location.isEmpty())
|
||||||
|
|||||||
@@ -38,8 +38,6 @@
|
|||||||
|
|
||||||
QT_FORWARD_DECLARE_CLASS(QMenu);
|
QT_FORWARD_DECLARE_CLASS(QMenu);
|
||||||
|
|
||||||
namespace VcsBase { class VcsCommand; }
|
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
|
|
||||||
class CORE_EXPORT IVersionControl : public QObject
|
class CORE_EXPORT IVersionControl : public QObject
|
||||||
@@ -223,17 +221,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual Utils::FilePaths additionalToolsPath() const;
|
virtual Utils::FilePaths additionalToolsPath() const;
|
||||||
|
|
||||||
/*!
|
|
||||||
* Return a VcsCommand capable of checking out \a url into \a baseDirectory, where
|
|
||||||
* a new subdirectory with \a localName will be created.
|
|
||||||
*
|
|
||||||
* \a extraArgs are passed on to the command being run.
|
|
||||||
*/
|
|
||||||
virtual VcsBase::VcsCommand *createInitialCheckoutCommand(const QString &url,
|
|
||||||
const Utils::FilePath &baseDirectory,
|
|
||||||
const QString &localName,
|
|
||||||
const QStringList &extraArgs);
|
|
||||||
|
|
||||||
virtual void fillLinkContextMenu(QMenu *menu,
|
virtual void fillLinkContextMenu(QMenu *menu,
|
||||||
const Utils::FilePath &workingDirectory,
|
const Utils::FilePath &workingDirectory,
|
||||||
const QString &reference);
|
const QString &reference);
|
||||||
|
|||||||
@@ -47,6 +47,7 @@
|
|||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <utils/qtcprocess.h>
|
#include <utils/qtcprocess.h>
|
||||||
|
|
||||||
|
#include <vcsbase/vcsbaseplugin.h>
|
||||||
#include <vcsbase/vcscommand.h>
|
#include <vcsbase/vcscommand.h>
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
@@ -61,6 +62,8 @@
|
|||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
|
using namespace VcsBase;
|
||||||
|
|
||||||
namespace GitLab {
|
namespace GitLab {
|
||||||
|
|
||||||
GitLabCloneDialog::GitLabCloneDialog(const Project &project, QWidget *parent)
|
GitLabCloneDialog::GitLabCloneDialog(const Project &project, QWidget *parent)
|
||||||
@@ -147,7 +150,8 @@ void GitLabCloneDialog::updateUi()
|
|||||||
|
|
||||||
void GitLabCloneDialog::cloneProject()
|
void GitLabCloneDialog::cloneProject()
|
||||||
{
|
{
|
||||||
Core::IVersionControl *vc = Core::VcsManager::versionControl(Utils::Id::fromString("G.Git"));
|
VcsBasePluginPrivate *vc = static_cast<VcsBasePluginPrivate *>(
|
||||||
|
Core::VcsManager::versionControl(Utils::Id::fromString("G.Git")));
|
||||||
QTC_ASSERT(vc, return);
|
QTC_ASSERT(vc, return);
|
||||||
const QStringList extraArgs = m_submodulesCB->isChecked() ? QStringList{ "--recursive" }
|
const QStringList extraArgs = m_submodulesCB->isChecked() ? QStringList{ "--recursive" }
|
||||||
: QStringList{};
|
: QStringList{};
|
||||||
@@ -156,13 +160,13 @@ void GitLabCloneDialog::cloneProject()
|
|||||||
m_directoryLE->text(), extraArgs);
|
m_directoryLE->text(), extraArgs);
|
||||||
const Utils::FilePath workingDirectory = m_pathChooser->absoluteFilePath();
|
const Utils::FilePath workingDirectory = m_pathChooser->absoluteFilePath();
|
||||||
m_command->setProgressiveOutput(true);
|
m_command->setProgressiveOutput(true);
|
||||||
connect(m_command, &VcsBase::VcsCommand::stdOutText, this, [this](const QString &text) {
|
connect(m_command, &VcsCommand::stdOutText, this, [this](const QString &text) {
|
||||||
m_cloneOutput->appendPlainText(text);
|
m_cloneOutput->appendPlainText(text);
|
||||||
});
|
});
|
||||||
connect(m_command, &VcsBase::VcsCommand::stdErrText, this, [this](const QString &text) {
|
connect(m_command, &VcsCommand::stdErrText, this, [this](const QString &text) {
|
||||||
m_cloneOutput->appendPlainText(text);
|
m_cloneOutput->appendPlainText(text);
|
||||||
});
|
});
|
||||||
connect(m_command, &VcsBase::VcsCommand::finished, this, &GitLabCloneDialog::cloneFinished);
|
connect(m_command, &VcsCommand::finished, this, &GitLabCloneDialog::cloneFinished);
|
||||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||||
|
|
||||||
m_cloneOutput->clear();
|
m_cloneOutput->clear();
|
||||||
|
|||||||
@@ -584,6 +584,18 @@ const VcsBasePluginState &VcsBasePluginPrivate::currentState() const
|
|||||||
return m_state;
|
return m_state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VcsCommand *VcsBasePluginPrivate::createInitialCheckoutCommand(const QString &url,
|
||||||
|
const Utils::FilePath &baseDirectory,
|
||||||
|
const QString &localName,
|
||||||
|
const QStringList &extraArgs)
|
||||||
|
{
|
||||||
|
Q_UNUSED(url)
|
||||||
|
Q_UNUSED(baseDirectory)
|
||||||
|
Q_UNUSED(localName)
|
||||||
|
Q_UNUSED(extraArgs)
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
bool VcsBasePluginPrivate::enableMenuAction(ActionState as, QAction *menuAction) const
|
bool VcsBasePluginPrivate::enableMenuAction(ActionState as, QAction *menuAction) const
|
||||||
{
|
{
|
||||||
qCDebug(baseLog) << "enableMenuAction" << menuAction->text() << as;
|
qCDebug(baseLog) << "enableMenuAction" << menuAction->text() << as;
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ namespace Internal { class State; }
|
|||||||
class VcsBaseSubmitEditor;
|
class VcsBaseSubmitEditor;
|
||||||
class VcsBasePluginPrivate;
|
class VcsBasePluginPrivate;
|
||||||
class VcsBasePluginStateData;
|
class VcsBasePluginStateData;
|
||||||
|
class VcsCommand;
|
||||||
|
|
||||||
// Documentation inside.
|
// Documentation inside.
|
||||||
class VCSBASE_EXPORT VcsBasePluginState
|
class VCSBASE_EXPORT VcsBasePluginState
|
||||||
@@ -144,6 +145,16 @@ public:
|
|||||||
|
|
||||||
const VcsBasePluginState ¤tState() const;
|
const VcsBasePluginState ¤tState() const;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Return a VcsCommand capable of checking out \a url into \a baseDirectory, where
|
||||||
|
* a new subdirectory with \a localName will be created.
|
||||||
|
*
|
||||||
|
* \a extraArgs are passed on to the command being run.
|
||||||
|
*/
|
||||||
|
virtual VcsCommand *createInitialCheckoutCommand(const QString &url,
|
||||||
|
const Utils::FilePath &baseDirectory,
|
||||||
|
const QString &localName,
|
||||||
|
const QStringList &extraArgs);
|
||||||
// Display name of the commit action
|
// Display name of the commit action
|
||||||
virtual QString commitDisplayName() const;
|
virtual QString commitDisplayName() const;
|
||||||
|
|
||||||
|
|||||||
@@ -24,9 +24,9 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "vcscommandpage.h"
|
#include "vcscommandpage.h"
|
||||||
|
#include "vcsbaseplugin.h"
|
||||||
#include "vcscommand.h"
|
#include "vcscommand.h"
|
||||||
|
|
||||||
#include <coreplugin/iversioncontrol.h>
|
|
||||||
#include <coreplugin/vcsmanager.h>
|
#include <coreplugin/vcsmanager.h>
|
||||||
|
|
||||||
#include <projectexplorer/jsonwizard/jsonwizard.h>
|
#include <projectexplorer/jsonwizard/jsonwizard.h>
|
||||||
@@ -354,7 +354,8 @@ void VcsCommandPage::delayedInitialize()
|
|||||||
QTC_ASSERT(wiz, return);
|
QTC_ASSERT(wiz, return);
|
||||||
|
|
||||||
const QString vcsId = wiz->expander()->expand(m_vcsId);
|
const QString vcsId = wiz->expander()->expand(m_vcsId);
|
||||||
IVersionControl *vc = VcsManager::versionControl(Id::fromString(vcsId));
|
VcsBasePluginPrivate *vc = static_cast<VcsBasePluginPrivate *>(
|
||||||
|
VcsManager::versionControl(Id::fromString(vcsId)));
|
||||||
if (!vc) {
|
if (!vc) {
|
||||||
qWarning() << QCoreApplication::translate("VcsBase::VcsCommandPage",
|
qWarning() << QCoreApplication::translate("VcsBase::VcsCommandPage",
|
||||||
"\"%1\" (%2) not found.")
|
"\"%1\" (%2) not found.")
|
||||||
|
|||||||
Reference in New Issue
Block a user