forked from qt-creator/qt-creator
Vcs: Merge IVersionControl and VcsBasePlugin hierarchies
They were 1:1 in parallel, with quite a bit of function call ping-pong inbetween, for code-sharing-by-inheritance. Merge them by making VcsBasePlugin inherit IVersionControl and merge the derived classes below. Size of this patch is hard to avoid as all seven systems have to move simultaneously. Non-necessary potential follow-up cleanup have been left out on purpose. Change-Id: Icb71e4182af3db21069cc637e7ae87ffa3829791 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -5,7 +5,6 @@ add_qtc_plugin(Subversion
|
||||
settingspage.cpp settingspage.h settingspage.ui
|
||||
subversionclient.cpp subversionclient.h
|
||||
subversionconstants.h
|
||||
subversioncontrol.cpp subversioncontrol.h
|
||||
subversioneditor.cpp subversioneditor.h
|
||||
subversionplugin.cpp subversionplugin.h
|
||||
subversionsettings.cpp subversionsettings.h
|
||||
|
||||
@@ -3,7 +3,6 @@ include(../../qtcreatorplugin.pri)
|
||||
HEADERS += annotationhighlighter.h \
|
||||
subversionplugin.h \
|
||||
subversionclient.h \
|
||||
subversioncontrol.h \
|
||||
settingspage.h \
|
||||
subversioneditor.h \
|
||||
subversionsubmiteditor.h \
|
||||
@@ -13,7 +12,6 @@ HEADERS += annotationhighlighter.h \
|
||||
SOURCES += annotationhighlighter.cpp \
|
||||
subversionplugin.cpp \
|
||||
subversionclient.cpp \
|
||||
subversioncontrol.cpp \
|
||||
settingspage.cpp \
|
||||
subversioneditor.cpp \
|
||||
subversionsubmiteditor.cpp \
|
||||
|
||||
@@ -20,8 +20,6 @@ QtcPlugin {
|
||||
"subversionclient.cpp",
|
||||
"subversionclient.h",
|
||||
"subversionconstants.h",
|
||||
"subversioncontrol.cpp",
|
||||
"subversioncontrol.h",
|
||||
"subversioneditor.cpp",
|
||||
"subversioneditor.h",
|
||||
"subversionplugin.cpp",
|
||||
|
||||
@@ -138,7 +138,7 @@ QStringList SubversionClient::addAuthenticationOptions(const VcsBaseClientSettin
|
||||
return rc;
|
||||
}
|
||||
|
||||
QString SubversionClient::synchronousTopic(const QString &repository)
|
||||
QString SubversionClient::synchronousTopic(const QString &repository) const
|
||||
{
|
||||
QStringList args;
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ public:
|
||||
// Add authorization options to the command line arguments.
|
||||
static QStringList addAuthenticationOptions(const VcsBase::VcsBaseClientSettings &settings);
|
||||
|
||||
QString synchronousTopic(const QString &repository);
|
||||
QString synchronousTopic(const QString &repository) const;
|
||||
|
||||
static QString escapeFile(const QString &file);
|
||||
static QStringList escapeFiles(const QStringList &files);
|
||||
|
||||
@@ -1,190 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2016 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "subversioncontrol.h"
|
||||
|
||||
#include "subversionclient.h"
|
||||
#include "subversionconstants.h"
|
||||
#include "subversionplugin.h"
|
||||
#include "subversionsettings.h"
|
||||
|
||||
#include <vcsbase/vcsbaseconstants.h>
|
||||
#include <vcsbase/vcsbaseclientsettings.h>
|
||||
#include <vcsbase/vcscommand.h>
|
||||
|
||||
#include <utils/fileutils.h>
|
||||
|
||||
#include <QFileInfo>
|
||||
|
||||
namespace Subversion {
|
||||
namespace Internal {
|
||||
|
||||
class SubversionTopicCache : public Core::IVersionControl::TopicCache
|
||||
{
|
||||
public:
|
||||
SubversionTopicCache(SubversionPluginPrivate *plugin) :
|
||||
m_plugin(plugin)
|
||||
{ }
|
||||
|
||||
protected:
|
||||
QString trackFile(const QString &repository) override
|
||||
{
|
||||
return m_plugin->monitorFile(repository);
|
||||
}
|
||||
|
||||
QString refreshTopic(const QString &repository) override
|
||||
{
|
||||
return m_plugin->synchronousTopic(repository);
|
||||
}
|
||||
|
||||
private:
|
||||
SubversionPluginPrivate *m_plugin;
|
||||
};
|
||||
|
||||
SubversionControl::SubversionControl(SubversionPluginPrivate *plugin) :
|
||||
m_plugin(plugin)
|
||||
{
|
||||
setTopicCache(new SubversionTopicCache(plugin));
|
||||
}
|
||||
|
||||
QString SubversionControl::displayName() const
|
||||
{
|
||||
return QLatin1String("subversion");
|
||||
}
|
||||
|
||||
Core::Id SubversionControl::id() const
|
||||
{
|
||||
return Core::Id(VcsBase::Constants::VCS_ID_SUBVERSION);
|
||||
}
|
||||
|
||||
bool SubversionControl::isVcsFileOrDirectory(const Utils::FilePath &fileName) const
|
||||
{
|
||||
return m_plugin->isVcsDirectory(fileName);
|
||||
}
|
||||
|
||||
bool SubversionControl::isConfigured() const
|
||||
{
|
||||
const Utils::FilePath binary = m_plugin->client()->vcsBinary();
|
||||
if (binary.isEmpty())
|
||||
return false;
|
||||
QFileInfo fi = binary.toFileInfo();
|
||||
return fi.exists() && fi.isFile() && fi.isExecutable();
|
||||
}
|
||||
|
||||
bool SubversionControl::supportsOperation(Operation operation) const
|
||||
{
|
||||
bool rc = isConfigured();
|
||||
switch (operation) {
|
||||
case AddOperation:
|
||||
case DeleteOperation:
|
||||
case MoveOperation:
|
||||
case AnnotateOperation:
|
||||
case InitialCheckoutOperation:
|
||||
break;
|
||||
case CreateRepositoryOperation:
|
||||
case SnapshotOperations:
|
||||
rc = false;
|
||||
break;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
bool SubversionControl::vcsOpen(const QString & /* fileName */)
|
||||
{
|
||||
// Open for edit: N/A
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SubversionControl::vcsAdd(const QString &fileName)
|
||||
{
|
||||
const QFileInfo fi(fileName);
|
||||
return m_plugin->vcsAdd(fi.absolutePath(), fi.fileName());
|
||||
}
|
||||
|
||||
bool SubversionControl::vcsDelete(const QString &fileName)
|
||||
{
|
||||
const QFileInfo fi(fileName);
|
||||
return m_plugin->vcsDelete(fi.absolutePath(), fi.fileName());
|
||||
}
|
||||
|
||||
bool SubversionControl::vcsMove(const QString &from, const QString &to)
|
||||
{
|
||||
const QFileInfo fromInfo(from);
|
||||
const QFileInfo toInfo(to);
|
||||
return m_plugin->vcsMove(fromInfo.absolutePath(), fromInfo.absoluteFilePath(), toInfo.absoluteFilePath());
|
||||
}
|
||||
|
||||
bool SubversionControl::vcsCreateRepository(const QString &)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SubversionControl::managesDirectory(const QString &directory, QString *topLevel) const
|
||||
{
|
||||
return m_plugin->managesDirectory(directory, topLevel);
|
||||
}
|
||||
|
||||
bool SubversionControl::managesFile(const QString &workingDirectory, const QString &fileName) const
|
||||
{
|
||||
return m_plugin->managesFile(workingDirectory, fileName);
|
||||
}
|
||||
|
||||
bool SubversionControl::vcsAnnotate(const QString &file, int line)
|
||||
{
|
||||
const QFileInfo fi(file);
|
||||
m_plugin->vcsAnnotate(fi.absolutePath(), fi.fileName(), QString(), line);
|
||||
return true;
|
||||
}
|
||||
|
||||
Core::ShellCommand *SubversionControl::createInitialCheckoutCommand(const QString &url,
|
||||
const Utils::FilePath &baseDirectory,
|
||||
const QString &localName,
|
||||
const QStringList &extraArgs)
|
||||
{
|
||||
SubversionClient *client = m_plugin->client();
|
||||
|
||||
QStringList args;
|
||||
args << QLatin1String("checkout");
|
||||
args << SubversionClient::addAuthenticationOptions(client->settings());
|
||||
args << QLatin1String(Subversion::Constants::NON_INTERACTIVE_OPTION);
|
||||
args << extraArgs << url << localName;
|
||||
|
||||
auto command = new VcsBase::VcsCommand(baseDirectory.toString(), client->processEnvironment());
|
||||
command->addJob({client->vcsBinary(), args}, -1);
|
||||
return command;
|
||||
}
|
||||
|
||||
void SubversionControl::emitRepositoryChanged(const QString &s)
|
||||
{
|
||||
emit repositoryChanged(s);
|
||||
}
|
||||
|
||||
void SubversionControl::emitFilesChanged(const QStringList &l)
|
||||
{
|
||||
emit filesChanged(l);
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Subversion
|
||||
@@ -1,71 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2016 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <coreplugin/iversioncontrol.h>
|
||||
|
||||
namespace Subversion {
|
||||
namespace Internal {
|
||||
|
||||
class SubversionPluginPrivate;
|
||||
|
||||
// Just a proxy for SubversionPlugin
|
||||
class SubversionControl : public Core::IVersionControl
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit SubversionControl(SubversionPluginPrivate *plugin);
|
||||
QString displayName() const final;
|
||||
Core::Id id() const final;
|
||||
bool isVcsFileOrDirectory(const Utils::FilePath &fileName) const final;
|
||||
|
||||
bool managesDirectory(const QString &directory, QString *topLevel = nullptr) const final;
|
||||
bool managesFile(const QString &workingDirectory, const QString &fileName) const final;
|
||||
|
||||
bool isConfigured() const final;
|
||||
bool supportsOperation(Operation operation) const final;
|
||||
bool vcsOpen(const QString &fileName) final;
|
||||
bool vcsAdd(const QString &fileName) final;
|
||||
bool vcsDelete(const QString &filename) final;
|
||||
bool vcsMove(const QString &from, const QString &to) final;
|
||||
bool vcsCreateRepository(const QString &directory) final;
|
||||
|
||||
bool vcsAnnotate(const QString &file, int line) final;
|
||||
|
||||
Core::ShellCommand *createInitialCheckoutCommand(const QString &url,
|
||||
const Utils::FilePath &baseDirectory,
|
||||
const QString &localName,
|
||||
const QStringList &extraArgs) final;
|
||||
|
||||
void emitRepositoryChanged(const QString &);
|
||||
void emitFilesChanged(const QStringList &);
|
||||
|
||||
private:
|
||||
SubversionPluginPrivate *m_plugin;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Subversion
|
||||
@@ -31,7 +31,6 @@
|
||||
#include "subversionsubmiteditor.h"
|
||||
#include "subversionclient.h"
|
||||
#include "subversionconstants.h"
|
||||
#include "subversioncontrol.h"
|
||||
|
||||
#include <vcsbase/basevcseditorfactory.h>
|
||||
#include <vcsbase/vcscommand.h>
|
||||
@@ -168,6 +167,28 @@ static inline QStringList svnDirectories()
|
||||
return rc;
|
||||
}
|
||||
|
||||
class SubversionTopicCache : public Core::IVersionControl::TopicCache
|
||||
{
|
||||
public:
|
||||
SubversionTopicCache(SubversionPluginPrivate *plugin) :
|
||||
m_plugin(plugin)
|
||||
{ }
|
||||
|
||||
protected:
|
||||
QString trackFile(const QString &repository) override
|
||||
{
|
||||
return m_plugin->monitorFile(repository);
|
||||
}
|
||||
|
||||
QString refreshTopic(const QString &repository) override
|
||||
{
|
||||
return m_plugin->synchronousTopic(repository);
|
||||
}
|
||||
|
||||
private:
|
||||
SubversionPluginPrivate *m_plugin;
|
||||
};
|
||||
|
||||
// ------------- SubversionPlugin
|
||||
|
||||
static SubversionPluginPrivate *dd = nullptr;
|
||||
@@ -180,8 +201,8 @@ SubversionPlugin::~SubversionPlugin()
|
||||
|
||||
SubversionPluginPrivate::~SubversionPluginPrivate()
|
||||
{
|
||||
delete m_client;
|
||||
cleanCommitMessageFile();
|
||||
delete m_client;
|
||||
}
|
||||
|
||||
void SubversionPluginPrivate::cleanCommitMessageFile()
|
||||
@@ -217,21 +238,21 @@ void SubversionPlugin::extensionsInitialized()
|
||||
dd->extensionsInitialized();
|
||||
}
|
||||
|
||||
SubversionPluginPrivate::SubversionPluginPrivate() :
|
||||
m_svnDirectories(svnDirectories())
|
||||
SubversionPluginPrivate::SubversionPluginPrivate()
|
||||
: VcsBasePluginPrivate(Context(Constants::SUBVERSION_CONTEXT)),
|
||||
m_svnDirectories(svnDirectories())
|
||||
{
|
||||
dd = this;
|
||||
|
||||
m_client = new SubversionClient(&m_settings);
|
||||
|
||||
setTopicCache(new SubversionTopicCache(this));
|
||||
|
||||
using namespace Constants;
|
||||
using namespace Core::Constants;
|
||||
Context context(SUBVERSION_CONTEXT);
|
||||
|
||||
auto vcsCtrl = new SubversionControl(this);
|
||||
initializeVcs(vcsCtrl, context);
|
||||
|
||||
m_client = new SubversionClient(&m_settings);
|
||||
|
||||
new SubversionSettingsPage(versionControl(), &m_settings, this);
|
||||
new SubversionSettingsPage(this, &m_settings, this);
|
||||
|
||||
new VcsSubmitEditorFactory(&submitParameters,
|
||||
[]() { return new SubversionSubmitEditor(&submitParameters); }, this);
|
||||
@@ -402,7 +423,7 @@ SubversionPluginPrivate::SubversionPluginPrivate() :
|
||||
m_commandLocator->appendCommand(command);
|
||||
}
|
||||
|
||||
bool SubversionPluginPrivate::isVcsDirectory(const FilePath &fileName)
|
||||
bool SubversionPluginPrivate::isVcsDirectory(const FilePath &fileName) const
|
||||
{
|
||||
const QString baseName = fileName.fileName();
|
||||
return fileName.isDir() && contains(m_svnDirectories, [baseName](const QString &s) {
|
||||
@@ -410,9 +431,8 @@ bool SubversionPluginPrivate::isVcsDirectory(const FilePath &fileName)
|
||||
});
|
||||
}
|
||||
|
||||
SubversionClient *SubversionPluginPrivate::client() const
|
||||
SubversionClient *SubversionPluginPrivate::client()
|
||||
{
|
||||
QTC_CHECK(m_client);
|
||||
return m_client;
|
||||
}
|
||||
|
||||
@@ -541,7 +561,7 @@ void SubversionPluginPrivate::revertAll()
|
||||
QMessageBox::warning(ICore::dialogParent(), title,
|
||||
tr("Revert failed: %1").arg(revertResponse.message), QMessageBox::Ok);
|
||||
else
|
||||
subVersionControl()->emitRepositoryChanged(state.topLevel());
|
||||
emit repositoryChanged(state.topLevel());
|
||||
}
|
||||
|
||||
void SubversionPluginPrivate::revertCurrentFile()
|
||||
@@ -579,7 +599,7 @@ void SubversionPluginPrivate::revertCurrentFile()
|
||||
VcsCommand::SshPasswordPrompt | VcsCommand::ShowStdOut);
|
||||
|
||||
if (!revertResponse.error)
|
||||
subVersionControl()->emitFilesChanged(QStringList(state.currentFile()));
|
||||
emit filesChanged(QStringList(state.currentFile()));
|
||||
}
|
||||
|
||||
void SubversionPluginPrivate::diffProject()
|
||||
@@ -751,19 +771,19 @@ void SubversionPluginPrivate::svnUpdate(const QString &workingDir, const QString
|
||||
= runSvn(workingDir, args, 10 * m_client->vcsTimeoutS(),
|
||||
VcsCommand::SshPasswordPrompt | VcsCommand::ShowStdOut);
|
||||
if (!response.error)
|
||||
subVersionControl()->emitRepositoryChanged(workingDir);
|
||||
emit repositoryChanged(workingDir);
|
||||
}
|
||||
|
||||
void SubversionPluginPrivate::annotateCurrentFile()
|
||||
{
|
||||
const VcsBasePluginState state = currentState();
|
||||
QTC_ASSERT(state.hasFile(), return);
|
||||
vcsAnnotate(state.currentFileTopLevel(), state.relativeCurrentFile());
|
||||
vcsAnnotateHelper(state.currentFileTopLevel(), state.relativeCurrentFile());
|
||||
}
|
||||
|
||||
void SubversionPluginPrivate::vcsAnnotate(const QString &workingDir, const QString &file,
|
||||
const QString &revision /* = QString() */,
|
||||
int lineNumber /* = -1 */)
|
||||
void SubversionPluginPrivate::vcsAnnotateHelper(const QString &workingDir, const QString &file,
|
||||
const QString &revision /* = QString() */,
|
||||
int lineNumber /* = -1 */)
|
||||
{
|
||||
const QString source = VcsBaseEditor::getSource(workingDir, file);
|
||||
QTextCodec *codec = VcsBaseEditor::getCodec(source);
|
||||
@@ -896,7 +916,8 @@ IEditor *SubversionPluginPrivate::showOutputInEditor(const QString &title, const
|
||||
auto e = qobject_cast<SubversionEditorWidget*>(editor->widget());
|
||||
if (!e)
|
||||
return nullptr;
|
||||
connect(e, &VcsBaseEditorWidget::annotateRevisionRequested, this, &SubversionPluginPrivate::vcsAnnotate);
|
||||
connect(e, &VcsBaseEditorWidget::annotateRevisionRequested,
|
||||
this, &SubversionPluginPrivate::vcsAnnotateHelper);
|
||||
e->setForceReadOnly(true);
|
||||
s.replace(QLatin1Char(' '), QLatin1Char('_'));
|
||||
e->textDocument()->setFallbackSaveAsFileName(s);
|
||||
@@ -1050,9 +1071,99 @@ bool SubversionPluginPrivate::checkSVNSubDir(const QDir &directory) const
|
||||
return false;
|
||||
}
|
||||
|
||||
SubversionControl *SubversionPluginPrivate::subVersionControl() const
|
||||
QString SubversionPluginPrivate::displayName() const
|
||||
{
|
||||
return static_cast<SubversionControl *>(versionControl());
|
||||
return QLatin1String("subversion");
|
||||
}
|
||||
|
||||
Core::Id SubversionPluginPrivate::id() const
|
||||
{
|
||||
return Core::Id(VcsBase::Constants::VCS_ID_SUBVERSION);
|
||||
}
|
||||
|
||||
bool SubversionPluginPrivate::isVcsFileOrDirectory(const Utils::FilePath &fileName) const
|
||||
{
|
||||
return isVcsDirectory(fileName);
|
||||
}
|
||||
|
||||
bool SubversionPluginPrivate::isConfigured() const
|
||||
{
|
||||
const Utils::FilePath binary = m_client->vcsBinary();
|
||||
if (binary.isEmpty())
|
||||
return false;
|
||||
QFileInfo fi = binary.toFileInfo();
|
||||
return fi.exists() && fi.isFile() && fi.isExecutable();
|
||||
}
|
||||
|
||||
bool SubversionPluginPrivate::supportsOperation(Operation operation) const
|
||||
{
|
||||
bool rc = isConfigured();
|
||||
switch (operation) {
|
||||
case AddOperation:
|
||||
case DeleteOperation:
|
||||
case MoveOperation:
|
||||
case AnnotateOperation:
|
||||
case InitialCheckoutOperation:
|
||||
break;
|
||||
case CreateRepositoryOperation:
|
||||
case SnapshotOperations:
|
||||
rc = false;
|
||||
break;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
bool SubversionPluginPrivate::vcsOpen(const QString & /* fileName */)
|
||||
{
|
||||
// Open for edit: N/A
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SubversionPluginPrivate::vcsAdd(const QString &fileName)
|
||||
{
|
||||
const QFileInfo fi(fileName);
|
||||
return vcsAdd(fi.absolutePath(), fi.fileName());
|
||||
}
|
||||
|
||||
bool SubversionPluginPrivate::vcsDelete(const QString &fileName)
|
||||
{
|
||||
const QFileInfo fi(fileName);
|
||||
return vcsDelete(fi.absolutePath(), fi.fileName());
|
||||
}
|
||||
|
||||
bool SubversionPluginPrivate::vcsMove(const QString &from, const QString &to)
|
||||
{
|
||||
const QFileInfo fromInfo(from);
|
||||
const QFileInfo toInfo(to);
|
||||
return vcsMove(fromInfo.absolutePath(), fromInfo.absoluteFilePath(), toInfo.absoluteFilePath());
|
||||
}
|
||||
|
||||
bool SubversionPluginPrivate::vcsCreateRepository(const QString &)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SubversionPluginPrivate::vcsAnnotate(const QString &file, int line)
|
||||
{
|
||||
const QFileInfo fi(file);
|
||||
vcsAnnotateHelper(fi.absolutePath(), fi.fileName(), QString(), line);
|
||||
return true;
|
||||
}
|
||||
|
||||
Core::ShellCommand *SubversionPluginPrivate::createInitialCheckoutCommand(const QString &url,
|
||||
const Utils::FilePath &baseDirectory,
|
||||
const QString &localName,
|
||||
const QStringList &extraArgs)
|
||||
{
|
||||
QStringList args;
|
||||
args << QLatin1String("checkout");
|
||||
args << SubversionClient::addAuthenticationOptions(m_settings);
|
||||
args << QLatin1String(Subversion::Constants::NON_INTERACTIVE_OPTION);
|
||||
args << extraArgs << url << localName;
|
||||
|
||||
auto command = new VcsBase::VcsCommand(baseDirectory.toString(), m_client->processEnvironment());
|
||||
command->addJob({m_client->vcsBinary(), args}, -1);
|
||||
return command;
|
||||
}
|
||||
|
||||
#ifdef WITH_TESTS
|
||||
@@ -1080,4 +1191,3 @@ void SubversionPlugin::testLogResolving()
|
||||
|
||||
} // Internal
|
||||
} // Subversion
|
||||
|
||||
|
||||
@@ -46,7 +46,6 @@ namespace Subversion {
|
||||
namespace Internal {
|
||||
|
||||
class SubversionSubmitEditor;
|
||||
class SubversionControl;
|
||||
class SubversionClient;
|
||||
|
||||
struct SubversionResponse
|
||||
@@ -70,9 +69,33 @@ public:
|
||||
SubversionPluginPrivate();
|
||||
~SubversionPluginPrivate() final;
|
||||
|
||||
bool isVcsDirectory(const Utils::FilePath &fileName);
|
||||
// IVersionControl
|
||||
QString displayName() const final;
|
||||
Core::Id id() const final;
|
||||
bool isVcsFileOrDirectory(const Utils::FilePath &fileName) const final;
|
||||
|
||||
SubversionClient *client() const;
|
||||
bool managesDirectory(const QString &directory, QString *topLevel) const final;
|
||||
bool managesFile(const QString &workingDirectory, const QString &fileName) const final;
|
||||
|
||||
bool isConfigured() const final;
|
||||
bool supportsOperation(Operation operation) const final;
|
||||
bool vcsOpen(const QString &fileName) final;
|
||||
bool vcsAdd(const QString &fileName) final;
|
||||
bool vcsDelete(const QString &filename) final;
|
||||
bool vcsMove(const QString &from, const QString &to) final;
|
||||
bool vcsCreateRepository(const QString &directory) final;
|
||||
|
||||
bool vcsAnnotate(const QString &file, int line) final;
|
||||
|
||||
Core::ShellCommand *createInitialCheckoutCommand(const QString &url,
|
||||
const Utils::FilePath &baseDirectory,
|
||||
const QString &localName,
|
||||
const QStringList &extraArgs) final;
|
||||
|
||||
bool isVcsDirectory(const Utils::FilePath &fileName) const;
|
||||
|
||||
///
|
||||
SubversionClient *client();
|
||||
|
||||
SubversionSubmitEditor *openSubversionSubmitEditor(const QString &fileName);
|
||||
|
||||
@@ -80,8 +103,6 @@ public:
|
||||
bool vcsAdd(const QString &workingDir, const QString &fileName);
|
||||
bool vcsDelete(const QString &workingDir, const QString &fileName);
|
||||
bool vcsMove(const QString &workingDir, const QString &from, const QString &to);
|
||||
bool managesDirectory(const QString &directory, QString *topLevel = nullptr) const;
|
||||
bool managesFile(const QString &workingDirectory, const QString &fileName) const;
|
||||
bool vcsCheckout(const QString &directory, const QByteArray &url);
|
||||
|
||||
static SubversionPluginPrivate *instance();
|
||||
@@ -92,7 +113,7 @@ public:
|
||||
const QStringList &arguments, int timeOutS,
|
||||
unsigned flags, QTextCodec *outputCodec = nullptr) const;
|
||||
void describe(const QString &source, const QString &changeNr);
|
||||
void vcsAnnotate(const QString &workingDir, const QString &file,
|
||||
void vcsAnnotateHelper(const QString &workingDir, const QString &file,
|
||||
const QString &revision = QString(), int lineNumber = -1);
|
||||
|
||||
protected:
|
||||
@@ -134,7 +155,6 @@ private:
|
||||
void svnUpdate(const QString &workingDir, const QString &relativePath = QString());
|
||||
bool checkSVNSubDir(const QDir &directory) const;
|
||||
void startCommit(const QString &workingDir, const QStringList &files = QStringList());
|
||||
inline SubversionControl *subVersionControl() const;
|
||||
|
||||
const QStringList m_svnDirectories;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user