jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/351926 )

Change subject: API: Deprecate diff and parse parameters in 
ApiQueryRevisionsBase
......................................................................


API: Deprecate diff and parse parameters in ApiQueryRevisionsBase

The 'rvdifftotext', 'rvdifftotextpst', 'rvdiffto', 'rvexpandtemplates',
'rvgeneratexml', 'rvparse', and 'rvprop=parsetree' parameters to
prop=revisions are deprecated, as are the similarly named parameters to
prop=deletedrevisions, list=allrevisions, and list=alldeletedrevisions.

Use action=compare, action=parse, or action=expandtemplates instead.

Bug: T164106
Change-Id: I6deaf550a4b96f0d35488bea7bfd6637d6d1c36a
---
M RELEASE-NOTES-1.30
M includes/api/ApiQueryRevisionsBase.php
M includes/api/i18n/en.json
3 files changed, 29 insertions(+), 7 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/RELEASE-NOTES-1.30 b/RELEASE-NOTES-1.30
index 0f5cb47..122a21c 100644
--- a/RELEASE-NOTES-1.30
+++ b/RELEASE-NOTES-1.30
@@ -70,6 +70,12 @@
   formatted as specified by the error formatter parameters.
 * action=compare can now handle arbitrary text, deleted revisions, and
   returning users and edit comments.
+* (T164106) The 'rvdifftotext', 'rvdifftotextpst', 'rvdiffto',
+  'rvexpandtemplates', 'rvgeneratexml', 'rvparse', and 'rvprop=parsetree'
+  parameters to prop=revisions are deprecated, as are the similarly named
+  parameters to prop=deletedrevisions, list=allrevisions, and
+  list=alldeletedrevisions. Use action=compare, action=parse, or
+  action=expandtemplates instead.
 
 === Action API internal changes in 1.30 ===
 * …
diff --git a/includes/api/ApiQueryRevisionsBase.php 
b/includes/api/ApiQueryRevisionsBase.php
index 696ec87..2ffd024 100644
--- a/includes/api/ApiQueryRevisionsBase.php
+++ b/includes/api/ApiQueryRevisionsBase.php
@@ -104,6 +104,17 @@
                $this->fld_tags = isset( $prop['tags'] );
                $this->fld_parsetree = isset( $prop['parsetree'] );
 
+               if ( $this->fld_parsetree ) {
+                       $encParam = $this->encodeParamName( 'prop' );
+                       $name = $this->getModuleName();
+                       $parent = $this->getParent();
+                       $parentParam = $parent->encodeParamName( 
$parent->getModuleManager()->getModuleGroup( $name ) );
+                       $this->addDeprecation(
+                               [ 'apiwarn-deprecation-parameter', 
"{$encParam}=parsetree" ],
+                               
"action=query&{$parentParam}={$name}&{$encParam}=parsetree"
+                       );
+               }
+
                if ( !empty( $params['contentformat'] ) ) {
                        $this->contentFormat = $params['contentformat'];
                }
@@ -477,6 +488,7 @@
                        'expandtemplates' => [
                                ApiBase::PARAM_DFLT => false,
                                ApiBase::PARAM_HELP_MSG => 
'apihelp-query+revisions+base-param-expandtemplates',
+                               ApiBase::PARAM_DEPRECATED => true,
                        ],
                        'generatexml' => [
                                ApiBase::PARAM_DFLT => false,
@@ -486,19 +498,23 @@
                        'parse' => [
                                ApiBase::PARAM_DFLT => false,
                                ApiBase::PARAM_HELP_MSG => 
'apihelp-query+revisions+base-param-parse',
+                               ApiBase::PARAM_DEPRECATED => true,
                        ],
                        'section' => [
                                ApiBase::PARAM_HELP_MSG => 
'apihelp-query+revisions+base-param-section',
                        ],
                        'diffto' => [
                                ApiBase::PARAM_HELP_MSG => 
'apihelp-query+revisions+base-param-diffto',
+                               ApiBase::PARAM_DEPRECATED => true,
                        ],
                        'difftotext' => [
                                ApiBase::PARAM_HELP_MSG => 
'apihelp-query+revisions+base-param-difftotext',
+                               ApiBase::PARAM_DEPRECATED => true,
                        ],
                        'difftotextpst' => [
                                ApiBase::PARAM_DFLT => false,
                                ApiBase::PARAM_HELP_MSG => 
'apihelp-query+revisions+base-param-difftotextpst',
+                               ApiBase::PARAM_DEPRECATED => true,
                        ],
                        'contentformat' => [
                                ApiBase::PARAM_TYPE => 
ContentHandler::getAllContentFormats(),
diff --git a/includes/api/i18n/en.json b/includes/api/i18n/en.json
index 5554105..33a6072 100644
--- a/includes/api/i18n/en.json
+++ b/includes/api/i18n/en.json
@@ -1105,15 +1105,15 @@
        "apihelp-query+revisions+base-paramvalue-prop-parsedcomment": "Parsed 
comment by the user for the revision.",
        "apihelp-query+revisions+base-paramvalue-prop-content": "Text of the 
revision.",
        "apihelp-query+revisions+base-paramvalue-prop-tags": "Tags for the 
revision.",
-       "apihelp-query+revisions+base-paramvalue-prop-parsetree": "The XML 
parse tree of revision content (requires content model <code>$1</code>).",
+       "apihelp-query+revisions+base-paramvalue-prop-parsetree": "<span 
class=\"apihelp-deprecated\">Deprecated.</span> Use 
<kbd>[[Special:ApiHelp/expandtemplates|action=expandtemplates]]</kbd> or 
<kbd>[[Special:ApiHelp/parse|action=parse]]</kbd> instead. The XML parse tree 
of revision content (requires content model <code>$1</code>).",
        "apihelp-query+revisions+base-param-limit": "Limit how many revisions 
will be returned.",
-       "apihelp-query+revisions+base-param-expandtemplates": "Expand templates 
in revision content (requires $1prop=content).",
-       "apihelp-query+revisions+base-param-generatexml": "Generate XML parse 
tree for revision content (requires $1prop=content; replaced by 
<kbd>$1prop=parsetree</kbd>).",
-       "apihelp-query+revisions+base-param-parse": "Parse revision content 
(requires $1prop=content). For performance reasons, if this option is used, 
$1limit is enforced to 1.",
+       "apihelp-query+revisions+base-param-expandtemplates": "Use 
<kbd>[[Special:ApiHelp/expandtemplates|action=expandtemplates]]</kbd> instead. 
Expand templates in revision content (requires $1prop=content).",
+       "apihelp-query+revisions+base-param-generatexml": "Use 
<kbd>[[Special:ApiHelp/expandtemplates|action=expandtemplates]]</kbd> or 
<kbd>[[Special:ApiHelp/parse|action=parse]]</kbd> instead. Generate XML parse 
tree for revision content (requires $1prop=content).",
+       "apihelp-query+revisions+base-param-parse": "Use 
<kbd>[[Special:ApiHelp/parse|action=parse]]</kbd> instead. Parse revision 
content (requires $1prop=content). For performance reasons, if this option is 
used, $1limit is enforced to 1.",
        "apihelp-query+revisions+base-param-section": "Only retrieve the 
content of this section number.",
-       "apihelp-query+revisions+base-param-diffto": "Revision ID to diff each 
revision to. Use <kbd>prev</kbd>, <kbd>next</kbd> and <kbd>cur</kbd> for the 
previous, next and current revision respectively.",
-       "apihelp-query+revisions+base-param-difftotext": "Text to diff each 
revision to. Only diffs a limited number of revisions. Overrides 
<var>$1diffto</var>. If <var>$1section</var> is set, only that section will be 
diffed against this text.",
-       "apihelp-query+revisions+base-param-difftotextpst": "Perform a pre-save 
transform on the text before diffing it. Only valid when used with 
<var>$1difftotext</var>.",
+       "apihelp-query+revisions+base-param-diffto": "Use 
<kbd>[[Special:ApiHelp/compare|action=compare]]</kbd> instead. Revision ID to 
diff each revision to. Use <kbd>prev</kbd>, <kbd>next</kbd> and <kbd>cur</kbd> 
for the previous, next and current revision respectively.",
+       "apihelp-query+revisions+base-param-difftotext": "Use 
<kbd>[[Special:ApiHelp/compare|action=compare]]</kbd> instead. Text to diff 
each revision to. Only diffs a limited number of revisions. Overrides 
<var>$1diffto</var>. If <var>$1section</var> is set, only that section will be 
diffed against this text.",
+       "apihelp-query+revisions+base-param-difftotextpst": "Use 
<kbd>[[Special:ApiHelp/compare|action=compare]]</kbd> instead. Perform a 
pre-save transform on the text before diffing it. Only valid when used with 
<var>$1difftotext</var>.",
        "apihelp-query+revisions+base-param-contentformat": "Serialization 
format used for <var>$1difftotext</var> and expected for output of content.",
 
        "apihelp-query+search-description": "Perform a full text search.",

-- 
To view, visit https://gerrit.wikimedia.org/r/351926
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I6deaf550a4b96f0d35488bea7bfd6637d6d1c36a
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Anomie <bjor...@wikimedia.org>
Gerrit-Reviewer: Anomie <bjor...@wikimedia.org>
Gerrit-Reviewer: Legoktm <lego...@member.fsf.org>
Gerrit-Reviewer: Reedy <re...@wikimedia.org>
Gerrit-Reviewer: Siebrand <siebr...@kitano.nl>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to