jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/406766 )
Change subject: [IMPR] transferbot: link to history subpage from summary ......................................................................
[IMPR] transferbot: link to history subpage from summary
Two cases for the /edithistory subpage link: -if target page namespace allows subpages, we can create an implicit link [[/subpage]] -else we need to copy the full page prefix title like [[page/subpage]]
Bug: T166516 Change-Id: I6aae0279b09aa0627685add0b1b3fd1ce92807f9 --- M scripts/transferbot.py 1 file changed, 5 insertions(+), 2 deletions(-)
Approvals: Zoranzoki21: Looks good to me, but someone else must approve Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/transferbot.py b/scripts/transferbot.py index e727e64..0a165cb 100755 --- a/scripts/transferbot.py +++ b/scripts/transferbot.py @@ -36,7 +36,7 @@ """ # # (C) Merlijn van Deen, 2014 -# (C) Pywikibot team, 2015-2017 +# (C) Pywikibot team, 2015-2018 # # Distributed under the terms of the MIT license. # @@ -134,10 +134,13 @@ 'gen_args': gen_args, 'prefix': prefix})
for page in gen: - summary = 'Moved page from %s' % page.title(asLink=True, insite=tosite) targetpage = pywikibot.Page(tosite, prefix + page.title()) edithistpage = pywikibot.Page(tosite, prefix + page.title() + '/edithistory') + summary = 'Moved page from {old} ([[{new}/edithistory|history]])'\ + .format(old=page.title(asLink=True, insite=tosite), + new=targetpage.title() if not + targetpage.namespace().subpages else '')
if targetpage.exists() and not overwrite: pywikibot.output(
pywikibot-commits@lists.wikimedia.org