HomePhabricator

Changes are wrongly detected in the last langlink

Authored by Malafaya.

Description

Changes are wrongly detected in the last langlink

This was first detected in cosmetic_changes.py, where pages not needing any
cosmetic changes were still being updated, and the supposed changed was an
unchanged langlink (the last one). Then I realized this also happens in
interwiki.py, but only when changes are supposed to be made to the page.
After checking textlib.py, I noticed that removeLanguageLinks() returns a
stripped version of the text whereas replaceLanguageLinks() does not. So
the actual difference is related to blank space.
This explains why cosmetic_changes.py detects a change and updates the page,
but interwiki.py does not: interwiki.py does not rely in differences in the
final text to make an update, but when it does need to make an update, it
outputs that diff.

This patch strips the text in replaceLanguageLinks() before returning if the
original text is stripped itself.

Change-Id: Icd7252be8dbccf3fb04a4b4a465f6b057e3a8e3a