I use Mercurial. Imagine the following scenario. Suppose I have a document which is in a state of ongoing revision. I print out a version and file it. Some time later, I want to check whether the version I have on disk has changed compared to the version I have printed out. For simplicity assume that the version I have on disk has no local changes; i.e. the current version in version control is also the most recent version.
It would be handy to have some identifier as part of the file, say for example the revision when the file was last changed. Then I could look at that and see that there has been no change since I last printed the file.
Now, Mercurial actually has an extension that does something similar, namely the keyword extension. However, this has problems, and is officially disapproved of by the Mercurial founder and project leader, Matt Mackall.
After looking at this, it occurred to me that though using this extension could be problematic, there was no real problem using LaTeX to embed version control information in a LaTeX file. And nearly all text documents I write are LaTeX documents.
I see there is prior art by Martin Scharrer. Any tips on how to do similar things in Mercurial?
EDIT: To be clear, my intention was not to use the keywords extension, but rather call hg directly from TeX as part of the typesetting.
$HGdate$in the document header and it'll get changed to teh checkout date – David Carlisle Jun 13 '14 at 09:17\date{\today -- $HG_NODE}into aversion.texfile you\inputin your main file in the appropriate place, every time you commit. See this – Bordaigorl Jun 13 '14 at 10:07\write18, I don't know the details, but look at the vc bundle documentation for how to do it. – Seamus Jun 13 '14 at 13:49write18call. – Faheem Mitha Jun 13 '14 at 13:56