Roan Kattouw schreef:
Bryan Tong Minh schreef:
So this does really output a diff string? Would it be possible to return a list of diffs in the following form:
[ { 'line': 4, 'action': 'removed' }, { 'line': 7, 'action': 'modified', 'old': 'test1', 'new': 'test2' } ]
Or is this not possible with the current diff engines?
Yes. I'll add an rvdiffformat parameter (later) so the diff can be output as normal, unified or array.
I've added rvdiffformat in r27913 [1]. The format of the array returned is as follows: (note that if lines are added or removed, line numbers will differ between versions)
For a changed line: { 'action': 'change' 'old': Old text 'new': New text 'oldline': Line number in old version 'newline': Line number in new version }
For an added line: { 'action': 'add' 'new': Added text 'newline': Line number in new version }
For a removed line: { 'action': 'delete' 'old': Removed text 'oldline': Line number in old version }
Unchanged lines are not listed.
Roan Kattouw (Catrope)
[1] http://svn.wikimedia.org/viewvc/mediawiki?view=rev&revision=27913