When moving pages with Page.move(), a redirect should be created by default. Users with the 'suppressredirect' right (e.g. bots on Wikimedia projects) should be able to suppress redirects. I propose adding a parameter leaveRedirect=True (or possibly suppresRedirect=False) to the function.
In svn revision 6084 i implemented leaveRedirect. By default this is true.
def move(self, newtitle, reason=None, movetalkpage=True, sysop=False,
- throttle=True, deleteAndMove=False, safe=True, fixredirects=True):
+ throttle=True, deleteAndMove=False, safe=True, fixredirects=True, leaveRedirect=True):
"""Move this page to new title given by newtitle. If safe, don't try
to move and delete if not directly requested.
@@ -2226,6 +2226,10 @@
predata['wpFixRedirects'] = '1'
else:
predata['wpFixRedirects'] = '0'
+ if leaveRedirect:
+ predata['wpLeaveRedirect'] = '1'
+ else:
+ predata['wpLeaveRedirect'] = '0'
if token:
https://sourceforge.net/tracker/index.php?func=detail&aid=2082329&group_id=93107&atid=603138
Thanks to Andre Engels who helped for this, please add to movepages.py:
86c86
< def __init__(self, generator, addprefix, delete, always, skipredirects, summary, leaveRedirect):
---
> def __init__(self, generator, addprefix, delete, always, skipredirects, summary):
93d92
< self.leaveRedirect = leaveRedirect
101c100
< if page.move(newPageTitle, msg, throttle=True, leaveRedirect=self.leaveRedirect) and self.delete:
---
> if page.move(newPageTitle, msg, throttle=True) and self.delete:
223d221
< leaveRedirect = True
249,250d246
< elif arg == '-noredirect':
< leaveRedirect = False
284c280
< bot = MovePagesBot(None, prefix, delete, always, skipredirects, summary, leaveRedirect)
---
> bot = MovePagesBot(None, prefix, delete, always, skipredirects, summary)
288c284
< bot = MovePagesBot(preloadingGen, prefix, delete, always, skipredirects, summary, leaveRedirect)
---
> bot = MovePagesBot(preloadingGen, prefix, delete, always, skipredirects, summary)