Rethink diff limits
authorMax Semenik <maxsem.wiki@gmail.com>
Wed, 27 Apr 2016 01:10:26 +0000 (18:10 -0700)
committerMax Semenik <maxsem.wiki@gmail.com>
Wed, 1 Jun 2016 23:30:58 +0000 (16:30 -0700)
commitdd57ff3cce86f3055c249a414c49b74f2bcb3497
tree31b4ef5a9227d629b5173b70a04b774c7ac0e8c3
parent218e89d5b467840b800316df2cefcc07509d0f1b
Rethink diff limits

Now, instead of "if your changed paragraphs are larger than 10Kb, you're
screwed":
* Instead of relying on overall length, estimate complexity after splitting to words
  and taking any equal head and tail out of equation.
* Estimate based on words changed, which better reflects the actual complexity
  of generating a diff.
* New limit is determined scientifically, i.e. "above that number XDebug starts
  complaining about recursion limits reached in Vagrant".

Caveat: if new limits are hit, the consequences are more widespread as all adjacent
changed paragraphs are displayed without word level diffs, as opposed to only the
paragraph that's too long being affected. However, the new limit is much higher and
in wikitext you're supposed to put empty lines between paragraphs anyway, negating
this problem.

Bug: T128697
Change-Id: I4e91c7c40f5afdd116b847a859b8517522302489
RELEASE-NOTES-1.28
autoload.php
includes/diff/ComplexityException.php [new file with mode: 0644]
includes/diff/DairikiDiff.php
includes/diff/DiffEngine.php
includes/diff/WordLevelDiff.php