Extension:MirrorTools/Move and mirrormove

Pseudocode

 * If we're moving revisions away from the source (i.e. move from) page, then:
 * If there are any revisions there that have a rev_mt_former_page that's not the same as the rev_page they're at:
 * If there's a redirect created, then:
 * Change their rev_page to that redirect page ID
 * If there's not a redirect created, then:
 * Change their rev_page to that rev_mt_former_page and clear their rev_mt_former_page.
 * Recreate the page entry if necessary.


 * If a page already exists at the target namespace and title:
 * 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.
 * Log the move.
 * Add the move to recentchanges.
 * Add the tags.
 * Return the timestamp, etc.