summaryrefslogtreecommitdiff
path: root/src/plugins/subversion
diff options
context:
space:
mode:
authorjkobus <jaroslaw.kobus@digia.com>2013-09-27 15:39:16 +0200
committerJarek Kobus <jaroslaw.kobus@digia.com>2013-10-16 08:34:15 +0200
commit0f4808a6294a7fd565f0dd3988d19838d05edd8d (patch)
tree3e31a2d436d2131ecfda44b46a64f416b06a5c93 /src/plugins/subversion
parent8474a6f1280bf26b62b37e094ed2f4013696bdcb (diff)
downloadqt-creator-0f4808a6294a7fd565f0dd3988d19838d05edd8d.tar.gz
Use VcsBaseClient::diff instead of svn's one
The first step in cleaning a mess in VCS Change-Id: I06ee1d9952cc91dc8f599f906d221850ffb0835b Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>
Diffstat (limited to 'src/plugins/subversion')
-rw-r--r--src/plugins/subversion/checkoutwizard.cpp3
-rw-r--r--src/plugins/subversion/subversion.pro2
-rw-r--r--src/plugins/subversion/subversion.qbs2
-rw-r--r--src/plugins/subversion/subversionclient.cpp216
-rw-r--r--src/plugins/subversion/subversionclient.h82
-rw-r--r--src/plugins/subversion/subversionplugin.cpp168
-rw-r--r--src/plugins/subversion/subversionplugin.h23
-rw-r--r--src/plugins/subversion/subversionsettings.cpp2
-rw-r--r--src/plugins/subversion/subversionsettings.h1
9 files changed, 319 insertions, 180 deletions
diff --git a/src/plugins/subversion/checkoutwizard.cpp b/src/plugins/subversion/checkoutwizard.cpp
index ed69c29e37..872cf16cfe 100644
--- a/src/plugins/subversion/checkoutwizard.cpp
+++ b/src/plugins/subversion/checkoutwizard.cpp
@@ -30,6 +30,7 @@
#include "checkoutwizard.h"
#include "checkoutwizardpage.h"
#include "subversionplugin.h"
+#include "subversionclient.h"
#include <coreplugin/iversioncontrol.h>
#include <vcsbase/command.h>
@@ -78,7 +79,7 @@ VcsBase::Command *CheckoutWizard::createCommand(const QList<QWizardPage*> &param
if (settings.hasAuthentication()) {
const QString user = settings.stringValue(SubversionSettings::userKey);
const QString pwd = settings.stringValue(SubversionSettings::passwordKey);
- args = SubversionPlugin::addAuthenticationOptions(args, user, pwd);
+ args = SubversionClient::addAuthenticationOptions(args, user, pwd);
}
VcsBase::Command *command = new VcsBase::Command(binary, workingDirectory,
QProcessEnvironment::systemEnvironment());
diff --git a/src/plugins/subversion/subversion.pro b/src/plugins/subversion/subversion.pro
index 6d2d9e21c0..ae8e211b62 100644
--- a/src/plugins/subversion/subversion.pro
+++ b/src/plugins/subversion/subversion.pro
@@ -2,6 +2,7 @@ include(../../qtcreatorplugin.pri)
HEADERS += annotationhighlighter.h \
subversionplugin.h \
+ subversionclient.h \
subversioncontrol.h \
settingspage.h \
subversioneditor.h \
@@ -13,6 +14,7 @@ HEADERS += annotationhighlighter.h \
SOURCES += annotationhighlighter.cpp \
subversionplugin.cpp \
+ subversionclient.cpp \
subversioncontrol.cpp \
settingspage.cpp \
subversioneditor.cpp \
diff --git a/src/plugins/subversion/subversion.qbs b/src/plugins/subversion/subversion.qbs
index d213ce0f77..6c3c48286f 100644
--- a/src/plugins/subversion/subversion.qbs
+++ b/src/plugins/subversion/subversion.qbs
@@ -23,6 +23,8 @@ QtcPlugin {
"settingspage.h",
"settingspage.ui",
"subversion.qrc",
+ "subversionclient.cpp",
+ "subversionclient.h",
"subversionconstants.h",
"subversioncontrol.cpp",
"subversioncontrol.h",
diff --git a/src/plugins/subversion/subversionclient.cpp b/src/plugins/subversion/subversionclient.cpp
new file mode 100644
index 0000000000..27ad0c655e
--- /dev/null
+++ b/src/plugins/subversion/subversionclient.cpp
@@ -0,0 +1,216 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** 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 Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#include "subversionclient.h"
+#include "subversionsettings.h"
+
+#include <vcsbase/vcsbaseplugin.h>
+#include <vcsbase/vcsbaseconstants.h>
+#include <vcsbase/vcsbaseeditorparameterwidget.h>
+#include <utils/synchronousprocess.h>
+
+#include <QDir>
+#include <QFileInfo>
+#include <QTextStream>
+#include <QDebug>
+
+namespace Subversion {
+namespace Internal {
+
+// Collect all parameters required for a diff to be able to associate them
+// with a diff editor and re-run the diff with parameters.
+struct SubversionDiffParameters
+{
+ QString workingDir;
+ QStringList extraOptions;
+ QStringList files;
+};
+
+// Parameter widget controlling whitespace diff mode, associated with a parameter
+class SubversionDiffParameterWidget : public VcsBase::VcsBaseEditorParameterWidget
+{
+ Q_OBJECT
+public:
+ explicit SubversionDiffParameterWidget(SubversionClient *client,
+ const SubversionDiffParameters &p,
+ QWidget *parent = 0);
+ QStringList arguments() const;
+ void executeCommand();
+
+private:
+ SubversionClient *m_client;
+ const SubversionDiffParameters m_params;
+};
+
+SubversionDiffParameterWidget::SubversionDiffParameterWidget(SubversionClient *client,
+ const SubversionDiffParameters &p,
+ QWidget *parent)
+ : VcsBase::VcsBaseEditorParameterWidget(parent), m_client(client), m_params(p)
+{
+ mapSetting(addToggleButton(QLatin1String("w"), tr("Ignore Whitespace")),
+ client->settings()->boolPointer(SubversionSettings::diffIgnoreWhiteSpaceKey));
+}
+
+QStringList SubversionDiffParameterWidget::arguments() const
+{
+ QStringList args;
+ // Subversion wants" -x -<ext-args>", default being -u
+ const QStringList formatArguments = VcsBaseEditorParameterWidget::arguments();
+ if (!formatArguments.isEmpty()) {
+ args << QLatin1String("-x")
+ << (QLatin1String("-u") + formatArguments.join(QString()));
+ }
+ return args;
+}
+
+void SubversionDiffParameterWidget::executeCommand()
+{
+ m_client->diff(m_params.workingDir, m_params.files, m_params.extraOptions);
+}
+
+SubversionClient::SubversionClient(SubversionSettings *settings) :
+ VcsBase::VcsBaseClient(settings)
+{
+}
+
+SubversionSettings *SubversionClient::settings() const
+{
+ return dynamic_cast<SubversionSettings *>(VcsBase::VcsBaseClient::settings());
+}
+
+Core::Id SubversionClient::vcsEditorKind(VcsCommand cmd) const
+{
+ switch (cmd) {
+ case DiffCommand:
+ return "Subversion Diff Editor"; // TODO: create subversionconstants.h
+ default:
+ return Core::Id();
+ }
+}
+
+SubversionClient::Version SubversionClient::svnVersion()
+{
+ if (m_svnVersionBinary != settings()->binaryPath()) {
+ QStringList args;
+ args << QLatin1String("--version") << QLatin1String("-q");
+ const Utils::SynchronousProcessResponse response =
+ VcsBase::VcsBasePlugin::runVcs(QDir().absolutePath(), settings()->binaryPath(),
+ args, settings()->timeOutMs());
+ if (response.result == Utils::SynchronousProcessResponse::Finished &&
+ response.exitCode == 0) {
+ m_svnVersionBinary = settings()->binaryPath();
+ m_svnVersion = response.stdOut.trimmed();
+ } else {
+ m_svnVersionBinary.clear();
+ m_svnVersion.clear();
+ }
+ }
+
+ SubversionClient::Version v;
+ if (::sscanf(m_svnVersion.toLatin1().constData(), "%d.%d.%d",
+ &v.majorVersion, &v.minorVersion, &v.patchVersion) != 3) {
+ v.majorVersion = v.minorVersion = v.patchVersion = -1;
+ }
+
+ return v;
+}
+
+// Add authorization options to the command line arguments.
+// SVN pre 1.5 does not accept "--userName" for "add", which is most likely
+// an oversight. As no password is needed for the option, generally omit it.
+QStringList SubversionClient::addAuthenticationOptions(const QStringList &args,
+ const QString &userName,
+ const QString &password)
+{
+ if (userName.isEmpty())
+ return args;
+ if (!args.empty() && args.front() == QLatin1String("add"))
+ return args;
+ QStringList rc;
+ rc.push_back(QLatin1String("--username"));
+ rc.push_back(userName);
+ if (!password.isEmpty()) {
+ rc.push_back(QLatin1String("--password"));
+ rc.push_back(password);
+ }
+ rc.append(args);
+ return rc;
+}
+
+void SubversionClient::diff(const QString &workingDir, const QStringList &files,
+ const QStringList &extraOptions)
+{
+ QStringList args(extraOptions);
+ Version v = svnVersion();
+
+ // --internal-diff is new in v1.7.0
+ if (v.majorVersion > 1 || (v.majorVersion == 1 && v.minorVersion >= 7))
+ args.append(QLatin1String("--internal-diff"));
+
+ const bool hasAuth = settings()->hasAuthentication();
+ const QString userName = hasAuth ? settings()->stringValue(SubversionSettings::userKey) : QString();
+ const QString password = hasAuth ? settings()->stringValue(SubversionSettings::passwordKey) : QString();
+ args = addAuthenticationOptions(args, userName, password);
+
+ VcsBaseClient::diff(workingDir, files, args);
+}
+
+QString SubversionClient::findTopLevelForFile(const QFileInfo &file) const
+{
+ Q_UNUSED(file)
+ return QString();
+}
+
+QStringList SubversionClient::revisionSpec(const QString &revision) const
+{
+ Q_UNUSED(revision)
+ return QStringList();
+}
+
+VcsBase::VcsBaseClient::StatusItem SubversionClient::parseStatusLine(const QString &line) const
+{
+ Q_UNUSED(line)
+ return VcsBase::VcsBaseClient::StatusItem();
+}
+
+VcsBase::VcsBaseEditorParameterWidget *SubversionClient::createDiffEditor(
+ const QString &workingDir, const QStringList &files, const QStringList &extraOptions)
+{
+ Q_UNUSED(extraOptions)
+ SubversionDiffParameters p;
+ p.workingDir = workingDir;
+ p.files = files;
+ p.extraOptions = extraOptions;
+ return new SubversionDiffParameterWidget(this, p);
+}
+
+} // namespace Internal
+} // namespace Subversion
+
+#include "subversionclient.moc"
diff --git a/src/plugins/subversion/subversionclient.h b/src/plugins/subversion/subversionclient.h
new file mode 100644
index 0000000000..e95dcea2a7
--- /dev/null
+++ b/src/plugins/subversion/subversionclient.h
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** 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 Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#ifndef SUBVERSIONCLIENT_H
+#define SUBVERSIONCLIENT_H
+
+#include "subversionsettings.h"
+#include <vcsbase/vcsbaseclient.h>
+
+namespace Subversion {
+namespace Internal {
+
+class SubversionSettings;
+
+class SubversionClient : public VcsBase::VcsBaseClient
+{
+ Q_OBJECT
+
+public:
+ SubversionClient(SubversionSettings *settings);
+
+ SubversionSettings *settings() const;
+ void diff(const QString &workingDir, const QStringList &files,
+ const QStringList &extraOptions = QStringList());
+ QString findTopLevelForFile(const QFileInfo &file) const;
+ QStringList revisionSpec(const QString &revision) const;
+ StatusItem parseStatusLine(const QString &line) const;
+
+ class Version {
+ public:
+ int majorVersion;
+ int minorVersion;
+ int patchVersion;
+ };
+
+ Version svnVersion();
+
+ // Add authorization options to the command line arguments.
+ static QStringList addAuthenticationOptions(const QStringList &args,
+ const QString &userName = QString(),
+ const QString &password = QString());
+
+protected:
+ Core::Id vcsEditorKind(VcsCommand cmd) const;
+ VcsBase::VcsBaseEditorParameterWidget *createDiffEditor(const QString &workingDir,
+ const QStringList &files,
+ const QStringList &extraOptions);
+private:
+ QString m_svnVersionBinary;
+ QString m_svnVersion;
+};
+
+} // namespace Internal
+} // namespace Subversion
+
+#endif // SUBVERSIONCLIENT_H
diff --git a/src/plugins/subversion/subversionplugin.cpp b/src/plugins/subversion/subversionplugin.cpp
index de57be400e..0b210ad363 100644
--- a/src/plugins/subversion/subversionplugin.cpp
+++ b/src/plugins/subversion/subversionplugin.cpp
@@ -33,6 +33,7 @@
#include "subversioneditor.h"
#include "subversionsubmiteditor.h"
+#include "subversionclient.h"
#include "subversionconstants.h"
#include "subversioncontrol.h"
#include "checkoutwizard.h"
@@ -209,6 +210,7 @@ SubversionPlugin::SubversionPlugin() :
SubversionPlugin::~SubversionPlugin()
{
+ delete m_client;
cleanCommitMessageFile();
}
@@ -251,6 +253,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e
return false;
m_settings.readSettings(Core::ICore::settings());
+ m_client = new SubversionClient(&m_settings);
addAutoReleasedObject(new SettingsPage);
@@ -497,52 +500,7 @@ bool SubversionPlugin::submitEditorAboutToClose()
void SubversionPlugin::diffCommitFiles(const QStringList &files)
{
- svnDiff(m_commitRepository, files);
-}
-
-// Collect all parameters required for a diff to be able to associate them
-// with a diff editor and re-run the diff with parameters.
-struct SubversionDiffParameters
-{
- QString workingDir;
- QStringList arguments;
- QStringList files;
- QString diffName;
-};
-
-// Parameter widget controlling whitespace diff mode, associated with a parameter
-class SubversionDiffParameterWidget : public VcsBase::VcsBaseEditorParameterWidget
-{
- Q_OBJECT
-public:
- explicit SubversionDiffParameterWidget(const SubversionDiffParameters &p, QWidget *parent = 0);
-
-signals:
- void reRunDiff(const Subversion::Internal::SubversionDiffParameters &);
-
-private slots:
- void triggerReRun();
-
-private:
- const SubversionDiffParameters m_parameters;
-};
-
-SubversionDiffParameterWidget::SubversionDiffParameterWidget(const SubversionDiffParameters &p, QWidget *parent) :
- VcsBase::VcsBaseEditorParameterWidget(parent), m_parameters(p)
-{
- setBaseArguments(p.arguments);
- addToggleButton(QLatin1String("w"), tr("Ignore Whitespace"));
- connect(this, SIGNAL(argumentsChanged()), this, SLOT(triggerReRun()));
-}
-
-void SubversionDiffParameterWidget::triggerReRun()
-{
- SubversionDiffParameters effectiveParameters = m_parameters;
- // Subversion wants" -x -<ext-args>", default being -u
- const QStringList a = arguments();
- if (!a.isEmpty())
- effectiveParameters.arguments << QLatin1String("-x") << (QLatin1String("-u") + a.join(QString()));
- emit reRunDiff(effectiveParameters);
+ m_client->diff(m_commitRepository, files);
}
static inline void setWorkingDirectory(Core::IEditor *editor, const QString &wd)
@@ -551,65 +509,6 @@ static inline void setWorkingDirectory(Core::IEditor *editor, const QString &wd)
ve->setWorkingDirectory(wd);
}
-void SubversionPlugin::svnDiff(const QString &workingDir, const QStringList &files, QString diffname)
-{
- SubversionDiffParameters p;
- p.workingDir = workingDir;
- p.files = files;
- p.diffName = diffname;
- svnDiff(p);
-}
-
-void SubversionPlugin::svnDiff(const Subversion::Internal::SubversionDiffParameters &p)
-{
- if (Subversion::Constants::debug)
- qDebug() << Q_FUNC_INFO << p.files << p.diffName;
- const QString source = VcsBase::VcsBaseEditorWidget::getSource(p.workingDir, p.files);
- QTextCodec *codec = source.isEmpty() ? static_cast<QTextCodec *>(0) : VcsBase::VcsBaseEditorWidget::getCodec(source);
-
- const QString diffName = p.files.count() == 1 && p.diffName.isEmpty() ?
- QFileInfo(p.files.front()).fileName() : p.diffName;
-
- QStringList args(QLatin1String("diff"));
- Version v = svnVersion();
- if (v.majorVersion > 1
- || (v.majorVersion == 1 && v.minorVersion >= 7)) // --internal-diff is new in v1.7.0
- args.append(QLatin1String("--internal-diff"));
- args.append(p.arguments);
- args << p.files;
-
- const SubversionResponse response =
- runSvn(p.workingDir, args, m_settings.timeOutMs(), 0, codec);
- if (response.error)
- return;
-
- // diff of a single file? re-use an existing view if possible to support
- // the common usage pattern of continuously changing and diffing a file
- const QString tag = VcsBase::VcsBaseEditorWidget::editorTag(VcsBase::DiffOutput, p.workingDir, p.files);
- // Show in the same editor if diff has been executed before
- if (Core::IEditor *existingEditor = VcsBase::VcsBaseEditorWidget::locateEditorByTag(tag)) {
- existingEditor->document()->setContents(response.stdOut.toUtf8());
- Core::EditorManager::activateEditor(existingEditor);
- setWorkingDirectory(existingEditor, p.workingDir);
- return;
- }
- const QString title = QString::fromLatin1("svn diff %1").arg(diffName);
- Core::IEditor *editor = showOutputInEditor(title, response.stdOut, VcsBase::DiffOutput, source, codec);
- setWorkingDirectory(editor, p.workingDir);
- VcsBase::VcsBaseEditorWidget::tagEditor(editor, tag);
- SubversionEditor *diffEditorWidget = qobject_cast<SubversionEditor *>(editor->widget());
- QTC_ASSERT(diffEditorWidget, return);
-
- // Wire up the parameter widget to trigger a re-run on
- // parameter change and 'revert' from inside the diff editor.
- SubversionDiffParameterWidget *pw = new SubversionDiffParameterWidget(p);
- connect(pw, SIGNAL(reRunDiff(Subversion::Internal::SubversionDiffParameters)),
- this, SLOT(svnDiff(Subversion::Internal::SubversionDiffParameters)));
- connect(diffEditorWidget, SIGNAL(diffChunkReverted(VcsBase::DiffChunk)),
- pw, SLOT(triggerReRun()));
- diffEditorWidget->setConfigurationWidget(pw);
-}
-
SubversionSubmitEditor *SubversionPlugin::openSubversionSubmitEditor(const QString &fileName)
{
Core::IEditor *editor = Core::EditorManager::openEditor(fileName,
@@ -724,15 +623,16 @@ void SubversionPlugin::diffProject()
{
const VcsBase::VcsBasePluginState state = currentState();
QTC_ASSERT(state.hasProject(), return);
- svnDiff(state.currentProjectTopLevel(), QStringList(state.relativeCurrentProject()),
- state.currentProjectName());
+ const QString relativeProject = state.relativeCurrentProject();
+ m_client->diff(state.currentProjectTopLevel(),
+ relativeProject.isEmpty() ? QStringList() : QStringList(relativeProject));
}
void SubversionPlugin::diffCurrentFile()
{
const VcsBase::VcsBasePluginState state = currentState();
QTC_ASSERT(state.hasFile(), return);
- svnDiff(state.currentFileTopLevel(), QStringList(state.relativeCurrentFile()));
+ m_client->diff(state.currentFileTopLevel(), QStringList(state.relativeCurrentFile()));
}
void SubversionPlugin::startCommitCurrentFile()
@@ -842,7 +742,7 @@ void SubversionPlugin::diffRepository()
{
const VcsBase::VcsBasePluginState state = currentState();
QTC_ASSERT(state.hasTopLevel(), return);
- svnDiff(state.topLevel(), QStringList());
+ m_client->diff(state.topLevel(), QStringList());
}
void SubversionPlugin::statusRepository()
@@ -1092,53 +992,6 @@ SubversionResponse
arguments, timeOut, flags, outputCodec);
}
-// Add authorization options to the command line arguments.
-// SVN pre 1.5 does not accept "--userName" for "add", which is most likely
-// an oversight. As no password is needed for the option, generally omit it.
-QStringList SubversionPlugin::addAuthenticationOptions(const QStringList &args,
- const QString &userName, const QString &password)
-{
- if (userName.isEmpty())
- return args;
- if (!args.empty() && args.front() == QLatin1String("add"))
- return args;
- QStringList rc;
- rc.push_back(QLatin1String("--username"));
- rc.push_back(userName);
- if (!password.isEmpty()) {
- rc.push_back(QLatin1String("--password"));
- rc.push_back(password);
- }
- rc.append(args);
- return rc;
-}
-
-SubversionPlugin::Version SubversionPlugin::svnVersion()
-{
- if (m_svnVersionBinary != m_settings.binaryPath()) {
- QStringList args;
- args << QLatin1String("--version") << QLatin1String("-q");
- const Utils::SynchronousProcessResponse response =
- VcsBase::VcsBasePlugin::runVcs(QDir().absolutePath(), m_settings.binaryPath(),
- args, m_settings.timeOutMs());
- if (response.result == Utils::SynchronousProcessResponse::Finished &&
- response.exitCode == 0) {
- m_svnVersionBinary = m_settings.binaryPath();
- m_svnVersion = response.stdOut.trimmed();
- } else {
- m_svnVersionBinary.clear();
- m_svnVersion.clear();
- }
- }
-
- SubversionPlugin::Version v;
- if (::sscanf(m_svnVersion.toLatin1().constData(), "%d.%d.%d",
- &v.majorVersion, &v.minorVersion, &v.patchVersion) != 3)
- v.majorVersion = v.minorVersion = v.patchVersion = -1;
-
- return v;
-}
-
SubversionResponse SubversionPlugin::runSvn(const QString &workingDir,
const QString &userName, const QString &password,
const QStringList &arguments, int timeOut,
@@ -1152,7 +1005,7 @@ SubversionResponse SubversionPlugin::runSvn(const QString &workingDir,
return response;
}
- const QStringList completeArguments = SubversionPlugin::addAuthenticationOptions(arguments, userName, password);
+ const QStringList completeArguments = SubversionClient::addAuthenticationOptions(arguments, userName, password);
const Utils::SynchronousProcessResponse sp_resp =
VcsBase::VcsBasePlugin::runVcs(workingDir, executable, completeArguments, timeOut,
flags, outputCodec);
@@ -1446,4 +1299,3 @@ void SubversionPlugin::testLogResolving()
Q_EXPORT_PLUGIN(Subversion::Internal::SubversionPlugin)
-#include "subversionplugin.moc"
diff --git a/src/plugins/subversion/subversionplugin.h b/src/plugins/subversion/subversionplugin.h
index 82940f1ae6..d6ddd80ce1 100644
--- a/src/plugins/subversion/subversionplugin.h
+++ b/src/plugins/subversion/subversionplugin.h
@@ -62,7 +62,7 @@ namespace Internal {
class SubversionSubmitEditor;
class SubversionControl;
-struct SubversionDiffParameters;
+class SubversionClient;
struct SubversionResponse
{
@@ -84,8 +84,6 @@ public:
bool initialize(const QStringList &arguments, QString *errorMessage);
- void svnDiff(const QString &workingDir, const QStringList &files, QString diffname = QString());
-
SubversionSubmitEditor *openSubversionSubmitEditor(const QString &fileName);
SubversionSettings settings() const;
@@ -102,24 +100,9 @@ public:
static SubversionPlugin *instance();
- // Add authorization options to the command line arguments.
- static QStringList addAuthenticationOptions(const QStringList &args,
- const QString &userName = QString(),
- const QString &password = QString());
-
- class Version {
- public:
- int majorVersion;
- int minorVersion;
- int patchVersion;
- };
-
- Version svnVersion();
-
public slots:
void vcsAnnotate(const QString &workingDir, const QString &file,
const QString &revision = QString(), int lineNumber = -1);
- void svnDiff(const Subversion::Internal::SubversionDiffParameters &p);
private slots:
void addCurrentFile();
@@ -183,6 +166,7 @@ private:
const QStringList m_svnDirectories;
SubversionSettings m_settings;
+ SubversionClient *m_client;
QString m_commitMessageFileName;
QString m_commitRepository;
@@ -214,9 +198,6 @@ private:
QAction *m_menuAction;
bool m_submitActionTriggered;
- QString m_svnVersionBinary;
- QString m_svnVersion;
-
static SubversionPlugin *m_subversionPluginInstance;
};
diff --git a/src/plugins/subversion/subversionsettings.cpp b/src/plugins/subversion/subversionsettings.cpp
index fe17e1c6bf..c066f0f7d6 100644
--- a/src/plugins/subversion/subversionsettings.cpp
+++ b/src/plugins/subversion/subversionsettings.cpp
@@ -41,6 +41,7 @@ const QLatin1String SubversionSettings::useAuthenticationKey("Authentication");
const QLatin1String SubversionSettings::userKey("User");
const QLatin1String SubversionSettings::passwordKey("Password");
const QLatin1String SubversionSettings::spaceIgnorantAnnotationKey("SpaceIgnorantAnnotation");
+const QLatin1String SubversionSettings::diffIgnoreWhiteSpaceKey("DiffIgnoreWhiteSpace");
SubversionSettings::SubversionSettings()
{
@@ -51,6 +52,7 @@ SubversionSettings::SubversionSettings()
declareKey(userKey, QLatin1String(""));
declareKey(passwordKey, QLatin1String(""));
declareKey(spaceIgnorantAnnotationKey, true);
+ declareKey(diffIgnoreWhiteSpaceKey, false);
}
bool SubversionSettings::hasAuthentication() const
diff --git a/src/plugins/subversion/subversionsettings.h b/src/plugins/subversion/subversionsettings.h
index a91d9c942d..f986f32aeb 100644
--- a/src/plugins/subversion/subversionsettings.h
+++ b/src/plugins/subversion/subversionsettings.h
@@ -42,6 +42,7 @@ public:
static const QLatin1String userKey;
static const QLatin1String passwordKey;
static const QLatin1String spaceIgnorantAnnotationKey;
+ static const QLatin1String diffIgnoreWhiteSpaceKey;
SubversionSettings();
bool hasAuthentication() const;