Last modified: 2014-01-30 03:54:00 UTC
The JavaScript variable wgRevisionId is 0 when editing with the wikitext editor. It seems that logically, it should be the revision used as the basis of the edit (the latest, or an oldid if that was used in the URL). wgCurRevisionId (which is always the latest) is set.
In fact, looking at the code, it's only set when action=view (by calling $outputPage->setRevisionId() in Article.php).