User:Shahadat/pageswap
This user script is currently active on Justapedia. This has been verified by an administrator or creator. If there is a problem, please leave a message on its talk page. |
pageswap is a script that allows a user to swap the histories of two pages (with reasonable restrictions), sometimes known as a history swap, sometimes called a round-robin move. The script requires the user to have suppressredirect
and move-subpages
rights (on enwiki, these are usually granted via either the page mover permission or as part of the standard administrator toolset). The script will add a "Swap" tab to the top of the page near the "new section" button.
To use this script: Copy the line below, then [[click here]], paste the line, and hit Publish changes.
{{subst:Iusc|User:Shahadat/pageswap.js|User:Shahadat/pageswap}}
Usage
- Go to the page to be swapped (i.e. page A as described at JP:PMVR#rr). At the top of the page, there should be an additional option to "Swap" (right below "Move" or "Purge"). Click "Swap".
- Enter the full page name complete with namespace prefix. (Click cancel to step out.) Proceed through the forms as appropriate. (Press "OK" for "Yes", "Cancel" for "No".)
- (Manually perform step 4 of the round-robin move if necessary, including correcting any moved redirects, and creating new redlinked talk pages.)
- (Manually perform any necessary post-move cleanup.)
Description
Because the round-robin move involves three distinct moves, in which each move step might fail for legitimate reasons, (target of a subpage is create-protected, a talk page is move-protected, or a target namespaces does not have subpages enabled, the target doesn't actually exist, etc) much of the script involves various checks to try to ensure that the three moves can happen unimpeded to the best of its ability. The script will detect the existence of talk pages and subpages and prompt the user. The script will not move subpages if the number of subpages of a namespace exceeds 100 pages. (In this case, attempt to perform the move manually, moving batches of 100 at a time.)
Editors can specify a default move reason via moveReasonDefault in their common.js or skin. This is helpful for those who use pageswap who frequently perform similar actions with the same move summary. (For example, var moveReasonDefault = "Requested at JP:RMTR" would be a reasonable summary for editors who answer JP:RMTR requests with a swap.)
If the move is complicated (i.e. subpages and talk subpages exist for source and destination), there will be a number of screens alerting you of the configuration to help you make the best decision about whether subpages should be moved. Occasionally, a (sub)page may be move-protected or immovable.
The prefix for the intermediate title (C) used for page B (as described at JP:PMVR#rr) is hard-coded as "Draft:Move/"
per convention.
To cancel out of the swap routine, currently you will need to step through the sequence of menus, but just be sure to click cancel at the last screen that asks if you want to proceed.
Page swapping is enabled for most namespaces that can handle them. The ability to swap a page in a subject space with one in a talk space is currently disabled. Users who are unable to suppressredirect
or move-subpages
have the swap functionality disabled.
Future goals
Ordered by priority:
- Check create protection of swap subpages (very uncommon)
- When sum of subj + talk >100 subpages and subj <= 100 subpages, consider disabling move talk. Allow option to move talk and subpages separately later?
Out of scope
- Checking template/file namespace for incoming links to orig. title
- Correcting redirects unrelated to the source page
- Correcting or retargeting any redirects of moved pages (including subpages)
- Other post-move cleanup (editnotices, lede/dab/hatnote corrections) These actions should be performed post-move manually.
- Create newly red-linked subject / talk / subpages as redirects
Script
The live script is at User:Shahadat/pageswap.js. Latest version published 02:00, 20 September 2013 (UTC).
A beta version of the script is also available at User:Shahadat/pageswapbeta.js (diff), but its use is not recommended, as it may contain untested or breaking code.
Script Attribution
This script was manually imported from Wikipedia in compliance with their CC-BY-SA license. This script is utilized either partially or in full, incorporating corrections, modifications, or imported from the original script. For details regarding the original script and its creator, please refer to the following link: https://en.wikipedia.org/wiki/User:Ahecht/Scripts/pageswap |