Xqt has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/225045

Change subject: [bugfix] Do not break links by default.
......................................................................

[bugfix] Do not break links by default.

allow_replace = True replace a section link to a unsectioned link and the link
will fail then whereas allow_replace_section = True keeps the link unchanged.
It should be the default behavior, not to break the link target.

Change-Id: I141f35fb8835b7e92adf1931b507af98f9018098
---
M pywikibot/bot.py
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/45/225045/1

diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index 2f85289..3cbb67d 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -816,8 +816,8 @@
     It shows various options which can be switched on and off:
     * allow_skip_link = True (skip the current link)
     * allow_unlink = True (unlink)
-    * allow_replace = True (just replace target, keep section and label)
-    * allow_replace_section = False (replace target and section, keep label)
+    * allow_replace = False (just replace target, keep section and label)
+    * allow_replace_section = True (replace target and section, keep label)
     * allow_replace_label = False (replace target and label, keep section)
     * allow_replace_all = False (replace target, section and label)
     (The boolean values are the default values)
@@ -866,8 +866,8 @@
         self.context_delta = 0
         self.allow_skip_link = True
         self.allow_unlink = True
-        self.allow_replace = True
-        self.allow_replace_section = False
+        self.allow_replace = False
+        self.allow_replace_section = True
         self.allow_replace_label = False
         self.allow_replace_all = False
         # Use list to preserve order

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I141f35fb8835b7e92adf1931b507af98f9018098
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <i...@gno.de>

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

Reply via email to