RevisionStore: add getRevisionIdsBetween method
Closed, ResolvedPublic

Description

Motivation:
This method would be useful to many extensions and other parts of code that want to obtain a list of revisions in a given range. This is quite hard to do properly, as the limit conditions are rather complicated, so it would be useful to have a tested, working method that does this.

This would be especially useful when obtaining a list of reverted revisions. Currently extensions are provided with the newest and oldest reverted revision ids, so this method could be used in such a case. I think at least Echo, FlaggedRevs and EventBus could make use of it. I also plan to use it in code marking reverted edits with mw-reverted change tag. See: T254074: Implement the reverted edit tag

Design:
I've decided for this method to return only ids, as this would suit many (but not all) use cases and is far simpler than returning entire revisions. If the method was to return RevisionRecords, it'd have to have a few extra parameters (which parts of the revision should we load? which slots should be loaded? should the content be loaded as well?) and it would quickly grow to a huge supermethod that has way too many responsibilities and is extremely hard to test reliably.

Event Timeline

Change 615698 had a related patch set uploaded (by Ostrzyciel; owner: Ostrzyciel):
[mediawiki/core@master] RevisionStore: add getRevisionIdsBetween method

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

Change 615698 merged by jenkins-bot:
[mediawiki/core@master] RevisionStore: add getRevisionIdsBetween method

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

Change 961958 had a related patch set uploaded (by Jforrester; author: Ostrzyciel):

[mediawiki/core@REL1_35] RevisionStore: add getRevisionIdsBetween method

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

Change 961958 merged by jenkins-bot:

[mediawiki/core@REL1_35] RevisionStore: add getRevisionIdsBetween method

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