diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2020-06-17 23:50:30 +0300 |
---|---|---|
committer | Orgad Shaneh <orgads@gmail.com> | 2020-06-18 05:17:59 +0000 |
commit | 5ebe34a33205199bd755283ed0a8c30870dadab8 (patch) | |
tree | 2a3c4429728f4cc6fe66e5bc1997dc6761164c5a /src | |
parent | e9df7825fa8a8714c3623154f1fc3cf13066a9a4 (diff) |
VCS: Add vcsDescribe
Already exists in all implementations, but there was no common declaration.
Change-Id: Ieb3d10d1936c207722b5001712bce41e8114dcdc
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/bazaar/bazaarplugin.cpp | 9 | ||||
-rw-r--r-- | src/plugins/clearcase/clearcaseplugin.cpp | 10 | ||||
-rw-r--r-- | src/plugins/coreplugin/iversioncontrol.h | 6 | ||||
-rw-r--r-- | src/plugins/cvs/cvsplugin.cpp | 12 | ||||
-rw-r--r-- | src/plugins/git/gitplugin.cpp | 16 | ||||
-rw-r--r-- | src/plugins/mercurial/mercurialplugin.cpp | 9 | ||||
-rw-r--r-- | src/plugins/perforce/perforceplugin.cpp | 12 | ||||
-rw-r--r-- | src/plugins/subversion/subversionplugin.cpp | 10 |
8 files changed, 44 insertions, 40 deletions
diff --git a/src/plugins/bazaar/bazaarplugin.cpp b/src/plugins/bazaar/bazaarplugin.cpp index c78605db07..1b0b43d21f 100644 --- a/src/plugins/bazaar/bazaarplugin.cpp +++ b/src/plugins/bazaar/bazaarplugin.cpp @@ -161,6 +161,7 @@ public: bool vcsMove(const QString &from, const QString &to) final; bool vcsCreateRepository(const QString &directory) final; void vcsAnnotate(const QString &file, int line) final; + void vcsDescribe(const QString &source, const QString &id) final { m_client.view(source, id); } Core::ShellCommand *createInitialCheckoutCommand(const QString &url, const Utils::FilePath &baseDirectory, @@ -203,8 +204,6 @@ public: void createDirectoryActions(const Core::Context &context); void createRepositoryActions(const Core::Context &context); - void describe(const QString &source, const QString &id) { m_client.view(source, id); } - // Variables BazaarSettings m_settings; BazaarClient m_client{&m_settings}; @@ -238,19 +237,19 @@ public: VcsEditorFactory logEditorFactory { &logEditorParameters, [] { return new BazaarEditorWidget; }, - std::bind(&BazaarPluginPrivate::describe, this, _1, _2) + std::bind(&BazaarPluginPrivate::vcsDescribe, this, _1, _2) }; VcsEditorFactory annotateEditorFactory { &annotateEditorParameters, [] { return new BazaarEditorWidget; }, - std::bind(&BazaarPluginPrivate::describe, this, _1, _2) + std::bind(&BazaarPluginPrivate::vcsDescribe, this, _1, _2) }; VcsEditorFactory diffEditorFactory { &diffEditorParameters, [] { return new BazaarEditorWidget; }, - std::bind(&BazaarPluginPrivate::describe, this, _1, _2) + std::bind(&BazaarPluginPrivate::vcsDescribe, this, _1, _2) }; }; diff --git a/src/plugins/clearcase/clearcaseplugin.cpp b/src/plugins/clearcase/clearcaseplugin.cpp index 12f6ea4de0..7c0c95c632 100644 --- a/src/plugins/clearcase/clearcaseplugin.cpp +++ b/src/plugins/clearcase/clearcaseplugin.cpp @@ -200,6 +200,7 @@ public: bool vcsCreateRepository(const QString &directory) final; void vcsAnnotate(const QString &file, int line) final; + void vcsDescribe(const QString &source, const QString &changeNr) final; QString vcsOpenText() const final; QString vcsMakeWritableText() const final; @@ -250,7 +251,6 @@ public: const QString &revision = QString(), int lineNumber = -1) const; bool newActivity(); void updateStreamAndView(); - void describe(const QString &source, const QString &changeNr); protected: void updateActions(VcsBase::VcsBasePluginPrivate::ActionState) override; @@ -363,19 +363,19 @@ private: VcsEditorFactory logEditorFactory { &logEditorParameters, [] { return new ClearCaseEditorWidget; }, - std::bind(&ClearCasePluginPrivate::describe, this, _1, _2) + std::bind(&ClearCasePluginPrivate::vcsDescribe, this, _1, _2) }; VcsEditorFactory annotateEditorFactory { &annotateEditorParameters, [] { return new ClearCaseEditorWidget; }, - std::bind(&ClearCasePluginPrivate::describe, this, _1, _2) + std::bind(&ClearCasePluginPrivate::vcsDescribe, this, _1, _2) }; VcsEditorFactory diffEditorFactory { &diffEditorParameters, [] { return new ClearCaseEditorWidget; }, - std::bind(&ClearCasePluginPrivate::describe, this, _1, _2) + std::bind(&ClearCasePluginPrivate::vcsDescribe, this, _1, _2) }; friend class ClearCasePlugin; @@ -1605,7 +1605,7 @@ void ClearCasePluginPrivate::vcsAnnotateHelper(const QString &workingDir, const } } -void ClearCasePluginPrivate::describe(const QString &source, const QString &changeNr) +void ClearCasePluginPrivate::vcsDescribe(const QString &source, const QString &changeNr) { const QFileInfo fi(source); QString topLevel; diff --git a/src/plugins/coreplugin/iversioncontrol.h b/src/plugins/coreplugin/iversioncontrol.h index 1dd4c02121..2546c05c2b 100644 --- a/src/plugins/coreplugin/iversioncontrol.h +++ b/src/plugins/coreplugin/iversioncontrol.h @@ -212,6 +212,11 @@ public: virtual QString vcsMakeWritableText() const; /*! + * Display details of reference + */ + virtual void vcsDescribe(const QString &workingDirectory, const QString &reference) = 0; + + /*! * Return a list of paths where tools that came with the VCS may be installed. * This is helpful on windows where e.g. git comes with a lot of nice unix tools. */ @@ -297,6 +302,7 @@ public: bool vcsMove(const QString &, const QString &) override { return false; } bool vcsCreateRepository(const QString &) override { return false; } void vcsAnnotate(const QString &, int) override {} + void vcsDescribe(const QString &, const QString &) override {} private: Id m_id; diff --git a/src/plugins/cvs/cvsplugin.cpp b/src/plugins/cvs/cvsplugin.cpp index 843ab756bf..9b2cad8cf9 100644 --- a/src/plugins/cvs/cvsplugin.cpp +++ b/src/plugins/cvs/cvsplugin.cpp @@ -271,6 +271,7 @@ public: void vcsAnnotate(const QString &workingDirectory, const QString &file, const QString &revision, int lineNumber); + void vcsDescribe(const QString &source, const QString &changeNr) final; protected: void updateActions(ActionState) final; @@ -318,7 +319,6 @@ private: bool describe(const QString &source, const QString &changeNr, QString *errorMessage); bool describe(const QString &toplevel, const QString &source, const QString &changeNr, QString *errorMessage); bool describe(const QString &repository, QList<CvsLogEntry> entries, QString *errorMessage); - void describeHelper(const QString &source, const QString &changeNr); void filelog(const QString &workingDir, const QString &file = QString(), bool enableAnnotationContextMenu = false); @@ -379,25 +379,25 @@ public: VcsEditorFactory commandLogEditorFactory { &commandLogEditorParameters, [] { return new CvsEditorWidget; }, - std::bind(&CvsPluginPrivate::describeHelper, this, _1, _2) + std::bind(&CvsPluginPrivate::vcsDescribe, this, _1, _2) }; VcsEditorFactory logEditorFactory { &logEditorParameters, [] { return new CvsEditorWidget; }, - std::bind(&CvsPluginPrivate::describeHelper, this, _1, _2) + std::bind(&CvsPluginPrivate::vcsDescribe, this, _1, _2) }; VcsEditorFactory annotateEditorFactory { &annotateEditorParameters, [] { return new CvsEditorWidget; }, - std::bind(&CvsPluginPrivate::describeHelper, this, _1, _2) + std::bind(&CvsPluginPrivate::vcsDescribe, this, _1, _2) }; VcsEditorFactory diffEditorFactory { &diffEditorParameters, [] { return new CvsEditorWidget; }, - std::bind(&CvsPluginPrivate::describeHelper, this, _1, _2) + std::bind(&CvsPluginPrivate::vcsDescribe, this, _1, _2) }; }; @@ -740,7 +740,7 @@ CvsPluginPrivate::CvsPluginPrivate() m_commandLocator->appendCommand(command); } -void CvsPluginPrivate::describeHelper(const QString &source, const QString &changeNr) +void CvsPluginPrivate::vcsDescribe(const QString &source, const QString &changeNr) { QString errorMessage; if (!describe(source, changeNr, &errorMessage)) diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp index 2ef9fa230b..2fb41dd1b8 100644 --- a/src/plugins/git/gitplugin.cpp +++ b/src/plugins/git/gitplugin.cpp @@ -250,6 +250,7 @@ public: bool vcsCreateRepository(const QString &directory) final; void vcsAnnotate(const QString &file, int line) final; + void vcsDescribe(const QString &source, const QString &id) final { m_gitClient.show(source, id); }; QString vcsTopic(const QString &directory) final; Core::ShellCommand *createInitialCheckoutCommand(const QString &url, @@ -264,7 +265,7 @@ public: menu->addAction(tr("&Copy \"%1\"").arg(reference), [reference] { QApplication::clipboard()->setText(reference); }); QAction *action = menu->addAction(tr("&Describe Change %1").arg(reference), - [=] { describe(workingDirectory, reference); }); + [=] { vcsDescribe(workingDirectory, reference); }); menu->setDefaultAction(action); GitClient::addChangeActions(menu, workingDirectory, reference); } @@ -366,7 +367,6 @@ public: void onApplySettings();; - void describe(const QString &source, const QString &id) { m_gitClient.show(source, id); }; Core::CommandLocator *m_commandLocator = nullptr; @@ -407,37 +407,37 @@ public: VcsEditorFactory svnLogEditorFactory { &svnLogEditorParameters, [] { return new GitEditorWidget; }, - std::bind(&GitPluginPrivate::describe, this, _1, _2) + std::bind(&GitPluginPrivate::vcsDescribe, this, _1, _2) }; VcsEditorFactory logEditorFactory { &logEditorParameters, [] { return new GitLogEditorWidgetT<GitEditorWidget>; }, - std::bind(&GitPluginPrivate::describe, this, _1, _2) + std::bind(&GitPluginPrivate::vcsDescribe, this, _1, _2) }; VcsEditorFactory reflogEditorFactory { &reflogEditorParameters, [] { return new GitLogEditorWidgetT<GitReflogEditorWidget>; }, - std::bind(&GitPluginPrivate::describe, this, _1, _2) + std::bind(&GitPluginPrivate::vcsDescribe, this, _1, _2) }; VcsEditorFactory blameEditorFactory { &blameEditorParameters, [] { return new GitEditorWidget; }, - std::bind(&GitPluginPrivate::describe, this, _1, _2) + std::bind(&GitPluginPrivate::vcsDescribe, this, _1, _2) }; VcsEditorFactory commitTextEditorFactory { &commitTextEditorParameters, [] { return new GitEditorWidget; }, - std::bind(&GitPluginPrivate::describe, this, _1, _2) + std::bind(&GitPluginPrivate::vcsDescribe, this, _1, _2) }; VcsEditorFactory rebaseEditorFactory { &rebaseEditorParameters, [] { return new GitEditorWidget; }, - std::bind(&GitPluginPrivate::describe, this, _1, _2) + std::bind(&GitPluginPrivate::vcsDescribe, this, _1, _2) }; VcsSubmitEditorFactory submitEditorFactory { diff --git a/src/plugins/mercurial/mercurialplugin.cpp b/src/plugins/mercurial/mercurialplugin.cpp index 9727167847..8b84bc9be0 100644 --- a/src/plugins/mercurial/mercurialplugin.cpp +++ b/src/plugins/mercurial/mercurialplugin.cpp @@ -145,6 +145,7 @@ public: bool vcsMove(const QString &from, const QString &to) final; bool vcsCreateRepository(const QString &directory) final; void vcsAnnotate(const QString &file, int line) final; + void vcsDescribe(const QString &source, const QString &id) final { m_client.view(source, id); } Core::ShellCommand *createInitialCheckoutCommand(const QString &url, const Utils::FilePath &baseDirectory, @@ -193,8 +194,6 @@ private: void createDirectoryActions(const Core::Context &context); void createRepositoryActions(const Core::Context &context); - void describe(const QString &source, const QString &id) { m_client.view(source, id); } - // Variables MercurialSettings m_settings; MercurialClient m_client{&m_settings}; @@ -232,19 +231,19 @@ public: VcsEditorFactory logEditorFactory { &logEditorParameters, [this] { return new MercurialEditorWidget(&m_client); }, - std::bind(&MercurialPluginPrivate::describe, this, _1, _2) + std::bind(&MercurialPluginPrivate::vcsDescribe, this, _1, _2) }; VcsEditorFactory annotateEditorFactory { &annotateEditorParameters, [this] { return new MercurialEditorWidget(&m_client); }, - std::bind(&MercurialPluginPrivate::describe, this, _1, _2) + std::bind(&MercurialPluginPrivate::vcsDescribe, this, _1, _2) }; VcsEditorFactory diffEditorFactory { &diffEditorParameters, [this] { return new MercurialEditorWidget(&m_client); }, - std::bind(&MercurialPluginPrivate::describe, this, _1, _2) + std::bind(&MercurialPluginPrivate::vcsDescribe, this, _1, _2) }; }; diff --git a/src/plugins/perforce/perforceplugin.cpp b/src/plugins/perforce/perforceplugin.cpp index ee31ca5cec..a04394e90d 100644 --- a/src/plugins/perforce/perforceplugin.cpp +++ b/src/plugins/perforce/perforceplugin.cpp @@ -224,6 +224,7 @@ public: bool vcsMove(const QString &from, const QString &to) final; bool vcsCreateRepository(const QString &directory) final; void vcsAnnotate(const QString &file, int line) final; + void vcsDescribe(const QString &source, const QString &n) final; QString vcsOpenText() const final; QString vcsMakeWritableText() const final; @@ -237,7 +238,6 @@ public: IEditor *openPerforceSubmitEditor(const QString &fileName, const QStringList &depotFileNames); - void describe(const QString &source, const QString &n); void getTopLevel(const QString &workingDirectory = QString(), bool isSync = false); void updateActions(ActionState) override; @@ -371,19 +371,19 @@ public: VcsEditorFactory logEditorFactory { &logEditorParameters, [] { return new PerforceEditorWidget; }, - std::bind(&PerforcePluginPrivate::describe, this, _1, _2) + std::bind(&PerforcePluginPrivate::vcsDescribe, this, _1, _2) }; VcsEditorFactory annotateEditorFactory { &annotateEditorParameters, [] { return new PerforceEditorWidget; }, - std::bind(&PerforcePluginPrivate::describe, this, _1, _2) + std::bind(&PerforcePluginPrivate::vcsDescribe, this, _1, _2) }; VcsEditorFactory diffEditorFactory { &diffEditorParameters, [] { return new PerforceEditorWidget; }, - std::bind(&PerforcePluginPrivate::describe, this, _1, _2) + std::bind(&PerforcePluginPrivate::vcsDescribe, this, _1, _2) }; }; @@ -824,7 +824,7 @@ void PerforcePluginPrivate::describeChange() { ChangeNumberDialog dia; if (dia.exec() == QDialog::Accepted && dia.number() > 0) - describe(QString(), QString::number(dia.number())); + vcsDescribe(QString(), QString::number(dia.number())); } void PerforcePluginPrivate::annotateCurrentFile() @@ -1539,7 +1539,7 @@ void PerforcePluginPrivate::p4Diff(const PerforceDiffParameters &p) diffEditorWidget->setEditorConfig(pw); } -void PerforcePluginPrivate::describe(const QString & source, const QString &n) +void PerforcePluginPrivate::vcsDescribe(const QString & source, const QString &n) { QTextCodec *codec = source.isEmpty() ? static_cast<QTextCodec *>(nullptr) : VcsBaseEditor::getCodec(source); diff --git a/src/plugins/subversion/subversionplugin.cpp b/src/plugins/subversion/subversionplugin.cpp index 0a480a18bb..ab7cf17285 100644 --- a/src/plugins/subversion/subversionplugin.cpp +++ b/src/plugins/subversion/subversionplugin.cpp @@ -222,6 +222,7 @@ public: bool vcsCreateRepository(const QString &directory) final; void vcsAnnotate(const QString &file, int line) final; + void vcsDescribe(const QString &source, const QString &changeNr) final; Core::ShellCommand *createInitialCheckoutCommand(const QString &url, const Utils::FilePath &baseDirectory, @@ -248,7 +249,6 @@ public: SubversionResponse runSvn(const QString &workingDir, const QStringList &arguments, int timeOutS, unsigned flags, QTextCodec *outputCodec = nullptr) const; - void describe(const QString &source, const QString &changeNr); void vcsAnnotateHelper(const QString &workingDir, const QString &file, const QString &revision = QString(), int lineNumber = -1); @@ -335,13 +335,13 @@ public: VcsEditorFactory logEditorFactory { &logEditorParameters, [] { return new SubversionEditorWidget; }, - std::bind(&SubversionPluginPrivate::describe, this, _1, _2) + std::bind(&SubversionPluginPrivate::vcsDescribe, this, _1, _2) }; VcsEditorFactory blameEditorFactory { &blameEditorParameters, [] { return new SubversionEditorWidget; }, - std::bind(&SubversionPluginPrivate::describe, this, _1, _2) + std::bind(&SubversionPluginPrivate::vcsDescribe, this, _1, _2) }; }; @@ -967,7 +967,7 @@ void SubversionPluginPrivate::projectStatus() svnStatus(state.currentProjectTopLevel(), state.relativeCurrentProject()); } -void SubversionPluginPrivate::describe(const QString &source, const QString &changeNr) +void SubversionPluginPrivate::vcsDescribe(const QString &source, const QString &changeNr) { // To describe a complete change, find the top level and then do //svn diff -r 472958:472959 <top level> @@ -1004,7 +1004,7 @@ void SubversionPluginPrivate::slotDescribe() return; const int revision = inputDialog.intValue(); - describe(state.topLevel(), QString::number(revision)); + vcsDescribe(state.topLevel(), QString::number(revision)); } void SubversionPluginPrivate::commitFromEditor() |