Page MenuHomePhabricator

Allow 3-way merge from arbitrary revisions after T297322
Open, Needs TriagePublicFeature

Description

Feature summary (what you would like to be able to do and where):
Allow 3-way merge from arbitrary revisions. The function removed in T297322 https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+/7b0c94fb0be44be33393e34cf8bc73798105f78e%5E%21/includes/EditPage.php

(Copied from T58184)
This allows the following cool "editprotected" flow:

  1. Requester puts the modified version of the requested page somewhere else (maybe a subpage of talk page).
  2. Requester tells admins revision ids of the modified version and the original revision which the modified one is based on, possibly with a gadget.
  3. An admin edits the page with &undoafter=<modified revid>&undo=<original revid>.
  4. If there's a conflict, admins can check &diff=<modified revid>&oldid=<original revid> and manually apply that, or ask the requester to submit a new "patch".

Event Timeline

Note that this would introduce bypassing Lockdown without any checks that a user can access the undoafter revision.

Note that this would introduce bypassing Lockdown without any checks that a user can access the undoafter revision.

May be we could add a config like $wgThirdWayMergeWhiteNamespaces or $wgMcrUndoWhiteTitleRegex? like:

$wgThirdWayMergeWhiteNamespaces[ NS_TEMPLATE ] = [ NS_USER, NS_TEMPLATE, NS_DRAFT ];

allow "3-way merge into template namespace" which source from user namespace, template namespace, or draft namespace.

Note that this would introduce bypassing Lockdown without any checks that a user can access the undoafter revision.

May be we could add a config like $wgThirdWayMergeWhiteNamespaces or $wgMcrUndoWhiteTitleRegex? like:

$wgThirdWayMergeWhiteNamespaces[ NS_TEMPLATE ] = [ NS_USER, NS_TEMPLATE, NS_DRAFT ];

allow "3-way merge into template namespace" which source from user namespace, template namespace, or draft namespace.

I don't think this is really a good solution. Instead one of the following should be considered:

  1. Properly check whether user have right to view pages related to the revision specified by undoafter.
  2. (This does not require any change in MediaWiki) Use a gadget to copy a revision to another page.
  3. (Even if there are proper permission control in MergeHistory, a feature may be useful to merge interleaved revisions) Use Special:MergeHistory to merge a revision to another page.

I think the 3-way merge workflow is cool, but it should be a dedicated special page with concrete security checks that verify each revision's visibility by the current user instead of subtly hacking it into action=undo in EditPage.