jenkins-bot has submitted this change and it was merged.
Change subject: replace.py: fix handling of addedCat, again ......................................................................
replace.py: fix handling of addedCat, again
In ReplaceRobot, with addedCat set, get categories from the new wikitext, otherwise old categories might be added back.
Change-Id: Ie7c19d0517882e465183cc7982af7f3c5f733bf6 --- M scripts/replace.py 1 file changed, 1 insertion(+), 1 deletion(-)
Approvals: XZise: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/replace.py b/scripts/replace.py index 2aa2d34..73c73aa 100755 --- a/scripts/replace.py +++ b/scripts/replace.py @@ -602,7 +602,7 @@ if hasattr(self, 'addedCat'): # Fetch only categories in wikitext, otherwise the others will # be explicitly added. - cats = textlib.getCategoryLinks(original_text) + cats = textlib.getCategoryLinks(new_text) if self.addedCat not in cats: cats.append(self.addedCat) new_text = textlib.replaceCategoryLinks(new_text,
pywikibot-commits@lists.wikimedia.org