Commit graph

10 commits

Author SHA1 Message Date
Máté Szabó
84ee098126 Fix ExternalTextDifferTest on macOS
In POSIX sh, `echo` flags are undefined. On macOS, this causes the
expected output to include literal `-n`s instead of the expected
behavior of not printing trailing newlines. So, use `printf` instead,
which should work consistently on both macOS and Linux.

Follows-up I5c506e3916285.

Change-Id: I54fc42d8fb8156fcf1d623ef4a7515092e634f09
2024-05-04 19:56:27 +00:00
Tim Starling
bd6ed0acdf Fix some spelling errors
Change-Id: I3632ce1ae00527f806652deb96cafb473aed3dcf
2024-03-18 20:58:11 +11:00
thiemowmde
0606238e15 Fix weird (auto-generated?) namespaces in PHPUnit tests
Same as I710a077.

Change-Id: I2b8eaf060229da3e0b5035fc43e38d610d554535
2024-02-20 19:23:36 +00:00
James D. Forrester
4bae64d1c7 Namespace includes/context
Bug: T353458
Change-Id: I4dbef138fd0110c14c70214282519189d70c94fb
2024-02-08 11:07:01 -05:00
MusikAnimal
02e7fdb26a diffs: add line number headings to inline diffs
Adds new regex in BaseTextDiffer::localizeLineNumbers() to work with
wikidiff2 inline diffs as well as table diffs.

Since there are no "columns" in inline mode, we have a new message to
indicate how the line numbers changed from the old diff versus the new.

Deprecate DifferenceEngine::localiseLineNumbers() as no longer used and
redundant to BaseTextDiffer::localizeLineNumbers().

Bug: T346460
Change-Id: I7b195879b677e2242ad73070fe19ad82121576a8
2023-10-09 22:53:14 -04:00
jenkins-bot
1d5e4f3d0a Merge "Add support for wikidiff2_multi_format_diff()" 2023-07-31 11:54:12 +00:00
Umherirrender
3010fd8157 tests: Skip ManifoldTextDifferTest on windows
Fails with a
1) ManifoldTextDifferTest::testHasFormatExternal
ExternalDiffEngine config points to a non-executable

Change-Id: Ifb32694f2c1cef32a354e20636463a22b7ab5f6f
2023-07-22 21:59:41 +02:00
Tim Starling
2ed4e600b4 Add support for wikidiff2_multi_format_diff()
Bug: T341754
Change-Id: I17396985d0b26516a06df17e9bd1343054521e01
2023-07-19 12:38:18 +10:00
Tim Starling
191ec35340 Add unified format
The code is there, so we may as well expose it.

Change-Id: Ic4cf5c0d4a5b46f0f0f25454815dcea1f69970eb
2023-07-19 12:38:18 +10:00
Tim Starling
2aa87cdf2c Factor out TextDiffer hierarchy from TextSlotDiffRenderer
* Follow the TODO comment in TextSlotDiffRenderer
  ::getTextDiffInternal() by moving the code out to three parallel
  implementations, namely ExternalTextDiffer, PhpTextDiffer and
  Wikidiff2TextDiffer.
* Add a container/factory class ManifoldTextDiffer to glue them
  together and collate available formats.
* Move the inline legend to Wikidiff2TextDiffer. Not the toggle since
  the ability to toggle depends on the available format, not the current
  format.
* Update the diff cache keys so that ManifoldTextDiffer can store the
  engine=>format map it used to generate the diff.
* Drop support for the second parameter to TextSlotDiffRenderer
 ::setEngine(), since nothing used it anymore.
* Provide a format batch API, since some engines are able to efficiently
  generate multiple formats. This might be used by DifferenceEngine in
  future.

Needs risky change notification for the cache key change.

Bug: T339184
Depends-On: I8a35b9b8ec1622c9a36d2496bdd24f51bc52c85f
Change-Id: I5c506e39162855aff53dd420dd8145156739059c
2023-07-19 12:38:18 +10:00