I am developing a Django site and am using hg for revision control. I would like to embed the changeset id to the footer of the site like Stackoverflow and Bitbucket do in their footer. What is the best way to accomplish this?
Do I have to use the Mercurial api? Is there a way to get hg form the CLI to output just the revision id so I can capture that in my deployment scripts and just include the simple text output in the template?
Methods you have used would be appreciated. Thanks
See: KeywordPlan
In your release-to-production process, use
hg idto get the current version information from Mercurial. You can easily stash that in a file that you then include in your Django templates.For example, in whatever script/process you use at release time, do:
And then at the bottom in your main Django template (or wherever), add:
(NOTE: the paths/directories may vary depending on how you have your template paths configured in Django).