vitaly-zdanevich added a comment.
Implemented locally:
def _git_word_diff(oldtext: str, newtext: str, context: int = 0) -> None:
with tempfile.TemporaryDirectory() as tmp_dir:
old_path = Path(tmp_dir) / 'old.txt'
new_path = Path(tmp_dir) / 'new.txt'
old_path.write_text(oldtext, encoding='utf-8')
new_path.write_text(newtext, encoding='utf-8')
subprocess.run(
[
'git', 'diff', '--no-index',
f'--unified={context}',
'--color=always',
'--color-words=.',
'--',
str(old_path),
str(new_path),
],
check=False,
)
pywikibot.showDiff = _git_word_diff
F71598056: image.png <https://phabricator.wikimedia.org/F71598056>
TASK DETAIL
https://phabricator.wikimedia.org/T415376
EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/
_______________________________________________
pywikibot-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]