Page MenuHomePhabricator

Add revid handling (revids=, drstartid= and drendid=) to list=deletedrevs
Closed, ResolvedPublic

Description

Currently "list=deletedrevs" does not support look-ups with revision IDs. However, "prop=revisions" does support look-ups based on revision IDs. I would like to be able to use revision IDs to do lookups of both deleted and non-deleted revisions in the same manner.

This means that revids would be supported for extracting specific revisions, drstartid would allow searching after a certain revision and drendid would allow searching before a certain revision.

Here is an example of what currently happens when trying the obvious with "revids":

https://en.wikipedia.org/w/api.php?action=query&list=deletedrevs&revids=48686706&drprop=revid|content&drlimit=1&format=jsonfm

returns:

{

"query-continue": {
    "deletedrevs": {
        "drcontinue": "0|\udbff\udfff|20060416102417|59516453"
    }
},
"query": {
    "badrevids": {
        "48686706": {
            "revid": 48686706
        }
    },
    "deletedrevs": [
        {
            "revisions": [
                {
                    "timestamp": "2006-08-19T00:06:25Z",
                    "revid": 70501255,
                    "*": <snip>
                }
            ],
            "ns": 0,
            "title": "\udbff\udfff"
        }
    ]
}

}


Version: unspecified
Severity: enhancement

Details

Reference
bz71396

Event Timeline

bzimport raised the priority of this task from to Normal.Nov 22 2014, 3:46 AM
bzimport added a project: MediaWiki-API.
bzimport set Reference to bz71396.
bzimport added a subscriber: Unknown Object (MLST).
Halfak created this task.Sep 28 2014, 7:56 PM

By the way, I think Special:Undelete has the same problem.

The reason for the "badrevids" is because deletedrevs is a bit of a strange module: it tries to combine the equivalent of both "list=allrevisions" (were that to exist) and "prop=revisions" into one module. The pageset functionality (which handles the "titles", "pageids", "revids", and "generator") is really intended for pages and revisions that exist, hence the error.

I'm inclined to deprecate list=deletedrevs using the pageset at all, and instead add all three of "drtitles", "drpageids", and "drrevids" to make it more like all other 'list' submodules. I'll have to check whether anyone is using list=deletedrevs with a generator though, as "drgenerator" would be insane.

(In reply to Brad Jorsch from comment #2)

I'm inclined to deprecate list=deletedrevs using the pageset at all, and
instead add all three of "drtitles", "drpageids", and "drrevids" to make it
more like all other 'list' submodules. I'll have to check whether anyone is
using list=deletedrevs with a generator though, as "drgenerator" would be
insane.

Or else make "prop=deletedrevisions" for mode 1 and "list=alldeletedrevisions" for modes 2 and 3, and deprecate list=deletedrevs entirely.

Change 168646 had a related patch set uploaded by Anomie:
API: Split list=deletedrevs into prop=deletedrevisions and list=alldeletedrevisions

https://gerrit.wikimedia.org/r/168646

Change 168646 merged by jenkins-bot:
API: Split list=deletedrevs into prop=deletedrevisions and list=alldeletedrevisions

https://gerrit.wikimedia.org/r/168646