Last modified: 2014-01-30 03:54:05 UTC
There is a wgCurRevisionId field currently, which as noted on the doc page is, "The top revision ID of the currently viewed page at the time the page was served" This is implemented with OutputPage->getWikiPage()->getLatest() (page_latest). However, in some cases, it is necessary to have the effective revision id. For a simple historical version (oldid=123), this would be the displayed version. For a diff (oldid=123&diff=next, oldid=123&diff=987, etc.), if would be the revision denoted by the diff. This should be available as wgRevisionId. This will allow JavaScript to look things up by the actual revision ID, or log it when necessary.
Change 81032 had a related patch set uploaded by Parent5446: Add wgRevisionId variable to ResourceLoader https://gerrit.wikimedia.org/r/81032
I actually had this patch in my repo a while ago. Turns out I forgot to upload it to Gerrit.
Change 81032 merged by jenkins-bot: Add wgRevisionId variable to ResourceLoader https://gerrit.wikimedia.org/r/81032
Documented at https://www.mediawiki.org/wiki/Manual:Interface/JavaScript#Page-specific