Extension:MirrorTools/Move and mirrormove

move

 * Disallow a move from a page that is remotely live.
 * Disallow a move to a page that is remotely live.
 * When a move is made from a page that has remotely deleted revisions:
 * If no redirect was created, create a new page entry for those revisions, with page_id equal to the rev_ar_page_id of the most recent revision in the history. Set rev_page to that page_id.
 * If a redirect was created, set their rev_page to that redirect's page_id.


 * When a move is made to a page that has remotely deleted revisions:
 * Change those revisions to the new rev_page
 * Change the rev_mt_former_page to the current rev_page
 * Delete the old page entry, since those revisions are going under the new page entry

mirrormove

 * If we're moving revisions away from the source (i.e. move from) page, then:
 * If there's a redirect created, then:
 * Change their rev_page to that redirect page ID
 * If their rev_mt_former_page is empty, change it to their current rev_page
 * If there's not a redirect created, then:
 * Change their rev_page to the rev_mt_former_page of the newest revision; create a new page entry with that same page_id
 * Delete the target page entry to make way for the new one.


 * If a page already exists at the target namespace and title:
 * If the only remotely live revision at the target page is a redirect pointing to the source page, then delete it.
 * Change the rev_page of the revisions at that local page to the page ID of the mirrored source page.
 * Also set the rev_mt_former_page of those revisions to the current page ID of those revisions.
 * Make any remotely live revisions that are at that target page not remotely live anymore.


 * Create a null revision.
 * Change the page namespace and title of the mirrored source (move from) page.
 * If the redirect wasn't suppressed on the remote wiki, then create a redirect.
 * If there are already local revisions at that page title, put the redirect revisions at that page. Otherwise, create a new page for the redirect.


 * Log the move.
 * Add the move to recentchanges.
 * Add the tags.
 * Return the timestamp, etc.