jenkins-bot has submitted this change and it was merged.
Change subject: Do only replace the first occurrence of redirects. ......................................................................
Do only replace the first occurrence of redirects.
The first occurrence of the redirect tag is the mw redirect token and will be changed by the bot. All the others may be prosa and kept unchanged.
This PS do not change redirects inside comments anymore; see https://en.wikipedia.org/wiki/Special:PermanentLink/619532917#Bot_messed_up_...
Change-Id: I456b1e6635570e2cf0e5892558b19dede060b35e --- M scripts/redirect.py 1 file changed, 3 insertions(+), 4 deletions(-)
Approvals: Ladsgroup: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/redirect.py b/scripts/redirect.py index 51d559c..6a99232 100755 --- a/scripts/redirect.py +++ b/scripts/redirect.py @@ -61,7 +61,7 @@ # # (C) Daniel Herding, 2004. # (C) Purodha Blissenbach, 2009. -# (C) xqt, 2009-2013 +# (C) xqt, 2009-2014 # (C) Pywikibot team, 2004-2013 # # Distributed under the terms of the MIT license. @@ -72,8 +72,7 @@ import re import datetime import pywikibot -from pywikibot import i18n -from pywikibot import xmlreader +from pywikibot import i18n, xmlreader
class RedirectGenerator: @@ -671,7 +670,7 @@ text = self.site.redirectRegex().sub( '#%s %s' % (self.site.redirect(True), targetlink), - oldText) + oldText, 1) if redir.title() == targetPage.title() or text == oldText: pywikibot.output(u"Note: Nothing left to do on %s" % redir.title(asLink=True))
pywikibot-commits@lists.wikimedia.org