jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/492485 )
Change subject: [bugfix] Remove link to /edithistory from page's edithistory summary.
......................................................................
[bugfix] Remove link to /edithistory from page's edithistory summary.
Bug: T216455
Change-Id: I469582460ac5ef4f5f03e1deb55c78070fe90cb5
---
M CREDITS
M scripts/transferbot.py
2 files changed, 12 insertions(+), 9 deletions(-)
Approvals:
Framawiki: Looks good to me, approved
jenkins-bot: Verified
diff --git a/CREDITS b/CREDITS
index 52d72ae..82984dc 100644
--- a/CREDITS
+++ b/CREDITS
@@ -73,6 +73,7 @@
Inductiveload
James Michael DuPont
Jamison Lofthouse
+Jacek.duszenko
Jan Zerebecki
Jared
jeedo
diff --git a/scripts/transferbot.py b/scripts/transferbot.py
index ee92924..fe9a809 100755
--- a/scripts/transferbot.py
+++ b/scripts/transferbot.py
@@ -138,10 +138,6 @@
+ page.title(with_ns=False))
targetpage = pywikibot.Page(tosite, target_title)
edithistpage = pywikibot.Page(tosite, target_title + '/edithistory')
- summary = 'Moved page from {old} ([[{new}/edithistory|history]])' \
- .format(old=page.title(as_link=True, insite=tosite),
- new=targetpage.title() if not
- targetpage.namespace().subpages else '')
if targetpage.exists() and not overwrite:
pywikibot.output(
@@ -158,21 +154,27 @@
pywikibot.log('Getting page text.')
text = page.get(get_redirect=True)
- text += ("<noinclude>\n\n<small>This page was moved from {0}.
It's "
+ source_link = page.title(as_link=True, insite=targetpage.site)
+ text += ('<noinclude>\n\n<small>This page was moved from {0}. Its
'
'edit history can be viewed at
{1}</small></noinclude>'
- .format(page.title(as_link=True, insite=targetpage.site),
+ .format(source_link,
edithistpage.title(as_link=True,
insite=targetpage.site)))
pywikibot.log('Getting edit history.')
historytable = page.getVersionHistoryTable()
- pywikibot.log('Putting page text.')
- targetpage.put(text, summary=summary)
-
pywikibot.log('Putting edit history.')
+ summary = 'Moved page from {source}'.format(source=source_link)
edithistpage.put(historytable, summary=summary)
+ pywikibot.log('Putting page text.')
+ edithist_link = ' ([[{target}/edithistory|history]])'.format(
+ target=targetpage.title()
+ if not targetpage.namespace().subpages else '')
+ summary += edithist_link
+ targetpage.put(text, summary=summary)
+
if __name__ == '__main__':
try:
--
To view, visit
https://gerrit.wikimedia.org/r/492485
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I469582460ac5ef4f5f03e1deb55c78070fe90cb5
Gerrit-Change-Number: 492485
Gerrit-PatchSet: 18
Gerrit-Owner: Jacek Duszenko <jacek.duszenko(a)gmail.com>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki(a)aol.com>
Gerrit-Reviewer: Framawiki <framawiki(a)tools.wmflabs.org>
Gerrit-Reviewer: Jacek Duszenko <jacek.duszenko(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)
Gerrit-CC: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-CC: Matěj Suchánek <matejsuchanek97(a)gmail.com>
Gerrit-CC: Welcome, new contributor! <ssethi(a)wikimedia.org>