Skip to content

Commit

Permalink
MCR: Deprecate and gut Revision class
Browse files Browse the repository at this point in the history
This is a re-submission of I4f24e7fbb68.

As a first major step towards Multi-Content-Revisions (MCR),
this patch turns the Revision class into a legacy proxy for
the new RevisionRecord and RevisionStore classes.

Backwards compatibility is maintained for all but some
rare edge cases, like constructing a completely empty
Revision object.

For more information on MCR, see
<https://www.mediawiki.org/wiki/Requests_for_comment/Multi-Content_Revisions>.

NOTE: once this is merged, verify create/delete/restore cycle on beta,
      ideally with emulated replication lag.

Bug: T174025
Change-Id: Ia4c20a91e98df0b9b14b138eb4825c55e5200384
  • Loading branch information
daniel authored and addshore committed Dec 21, 2017
1 parent 13df3d2 commit 6af796f
Show file tree
Hide file tree
Showing 13 changed files with 718 additions and 1,421 deletions.
7 changes: 7 additions & 0 deletions RELEASE-NOTES-1.31
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ changes to languages because of Phabricator reports.
* (T180052) Mirandese (mwl) now supports gendered NS_USER/NS_USER_TALK namespaces.

=== Other changes in 1.31 ===
* Introducing multi-content-revision capability into the storage layer. For details,
see <https://www.mediawiki.org/wiki/Requests_for_comment/Multi-Content_Revisions>.
* The Revision class was deprecated in favor of RevisionStore, BlobStore, and
RevisionRecord and its subclasses.
* MessageBlobStore::insertMessageBlob() (deprecated in 1.27) was removed.
* The global function wfBCP47 was renamed to LanguageCode::bcp47.
* The global function wfBCP47 is now deprecated.
Expand Down Expand Up @@ -123,6 +127,9 @@ changes to languages because of Phabricator reports.
* The Block class will no longer accept usable-but-missing usernames for
'byText' or ->setBlocker(). Callers should either ensure the blocker exists
locally or use a new interwiki-format username like "iw>Example".
* The RevisionInsertComplete hook is now deprecated, use RevisionRecordInserted instead.
RevisionInsertComplete is still called, but the second and third parameter will always be null.
Hard deprecation is scheduled for 1.32.
* The following methods that get and set ParserOutput state are deprecated.
Callers should use the new stateless $options parameter to
ParserOutput::getText() instead.
Expand Down
16 changes: 8 additions & 8 deletions docs/hooks.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2810,14 +2810,14 @@ called after the addition of 'qunit' and MediaWiki testing resources.
added to any module.
&$ResourceLoader: object

'RevisionInsertComplete': Called after a revision is inserted into the database.
&$revision: the Revision
$data: the data stored in old_text. The meaning depends on $flags: if external
is set, it's the URL of the revision text in external storage; otherwise,
it's the revision text itself. In either case, if gzip is set, the revision
text is gzipped.
$flags: a comma-delimited list of strings representing the options used. May
include: utf8 (this will always be set for new revisions); gzip; external.
'RevisionRecordInserted': Called after a revision is inserted into the database.
$revisionRecord: the RevisionRecord that has just been inserted.

'RevisionInsertComplete': DEPRECATED! Use RevisionRecordInserted hook instead.
Called after a revision is inserted into the database.
$revision: the Revision
$data: DEPRECATED! Always null!
$flags: DEPRECATED! Always null!

'SearchableNamespaces': An option to modify which namespaces are searchable.
&$arr: Array of namespaces ($nsId => $name) which will be used.
Expand Down
Loading

0 comments on commit 6af796f

Please sign in to comment.