Last modified: 2011-03-13 18:05:25 UTC
Created attachment 3797 [details]
Includes previous revision ID in prop=revisions
This is useful for implementing diffs in action=feedwatchlist (see also bug 10268) and for building diff links in general.
Could the attached patch be reviewed and applied to the trunk?
Created attachment 3821 [details]
I modified the patch a bit (attached), but it wouldn't work -- rc table may not contain relevant information (for example when the edit is old, imports, etc). It seems rev table is the only one with the needed info.
(In reply to comment #2)
> It seems rev table is the only one with the needed info.
The rev_parent_id was added in 1.10; getting lastids for pre-1.10 revisions wouldn't work either. It's better than using RC, though. I'll rework the patch.
Note that revision.rev_parent_id does not contain the "previous revision" identifier, but rather, the revision from which the current can be considered to be derived. This might be further reinforced in the future to assist with "blame map" generation and additional anti-vandalism and analysis goodies.
Incorrectly relying upon a column is probably a bad idea if the data semantics are not what you expect later.
(In reply to comment #4)
> Note that revision.rev_parent_id does not contain the "previous revision"
> identifier, but rather, the revision from which the current can be considered
> to be derived.
That only leaves recentchanges.rc_last_oldid, which is only conserved for a week (sadly).
But then, how do they do this: http://en.wikipedia.org/w/index.php?title=Dog&diff=prev&oldid=178421 This edit is five years old, yet the previous and next revision are in the DB somehow. I think they do that based on timestamps in the revision table, I'll rewrite my patch to use that.
Fixed in r23584 (using timestamps in the revision table)
Reverted in 23596 because of the following:
* lastid is confusing. Need a better name.
* rvprop should behave in an expected manner. If the user asks for
timestamp, she should receive timestamp. If the user asks for lastid,
the user should NOT get the timestamp.
* DB must not be queried for each revision; instead a single query needs to be made. (not sure yet of how to do this, but multiple queries is not a solution)
Closing as WONTFIX since there appears to be no way to implement this without strangling the database.