jenkins-bot has submitted this change and it was merged.

Change subject: [SYNC] Synchronize code with compat branch
......................................................................


[SYNC] Synchronize code with compat branch

Change-Id: I9dd3536c997d0e8774f0e6c42ae2119d2c9d3fe4
---
M scripts/redirect.py
1 file changed, 14 insertions(+), 9 deletions(-)

Approvals:
  Merlijn van Deen: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/scripts/redirect.py b/scripts/redirect.py
index 9c96fad..8ece506 100755
--- a/scripts/redirect.py
+++ b/scripts/redirect.py
@@ -22,11 +22,13 @@
                "-xml:filename.xml". Cannot be used with -fullscan or -moves.
 
 -fullscan      Retrieve redirect pages from live wiki, not from a special page
+               Cannot be used with -xml.
 
 -moves         Use the page move log to find double-redirect candidates. Only
                works with action "double", does not work with -xml.
 
-               NOTE: If neither of -xml -fullscan -moves is given, info will be
+               NOTE: You may use only one of these options above.
+               If neither of -xml -fullscan -moves is given, info will be
                loaded from a special page of the live wiki.
 
 -namespace:n   Namespace to process. Can be given multiple times, for several
@@ -291,7 +293,7 @@
             gen = self.get_moved_pages_redirects()
             for redir_page in gen:
                 yield redir_page.title()
-        elif self.use_api and not self.use_move_log:
+        elif self.use_api:
             count = 0
             for (pagetitle, type, target, final) \
                     in self.get_redirects_via_api(maxlen=2):
@@ -407,9 +409,12 @@
                     try:
                         redir_page.delete(reason, prompt=False)
                     except pywikibot.NoUsername:
-                        if ((i18n.twhas_key(targetPage.site.lang, 
'redirect-broken-redirect-template') and
-                             i18n.twhas_key(targetPage.site.lang, 
'redirect-remove-broken')
-                             ) or targetPage.site.lang == '-'):
+                        if ((i18n.twhas_key(
+                             targetPage.site.lang,
+                             'redirect-broken-redirect-template') and
+                             i18n.twhas_key(targetPage.site.lang,
+                                            'redirect-remove-broken')) or \
+                                            targetPage.site.lang == '-'):
                             pywikibot.output(u"No sysop in user-config.py, "
                                              u"put page to speedy deletion.")
                             content = redir_page.get(get_redirect=True)
@@ -705,11 +710,11 @@
             pywikibot.output(u'Unknown argument: %s' % arg)
 
     if (
-        (not action) or
-        (xmlFilename and moved_pages) or
-        (fullscan and xmlFilename)
+        not action or
+        xmlFilename and moved_pages or
+        fullscan and xmlFilename
     ):
-        pywikibot.showHelp('redirect')
+        pywikibot.showHelp()
     else:
         gen = RedirectGenerator(xmlFilename, namespaces, offset, moved_pages,
                                 fullscan, start, until, number, step)

-- 
To view, visit https://gerrit.wikimedia.org/r/101028
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I9dd3536c997d0e8774f0e6c42ae2119d2c9d3fe4
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <i...@gno.de>
Gerrit-Reviewer: Ladsgroup <ladsgr...@gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhall...@arctus.nl>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to