Thanks for the quick implementation. Can you please post an example on how to call this new function of the API? Is this readily available on Wikipedia? If not, when will it be?
-- Sérgio Nunes
On 11/27/07, Roan Kattouw roan.kattouw@home.nl wrote:
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
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-api