Reputation: 1347
I need the current version (version of the latest file) and it's tag to be included in files when I do hg archive. When using keywords extension in includes the latest version of each file, not the current version. Example:
repository contents:
file1 Jan 1st 2013 latest change tag v2.0
file2 Mar 1st 2013 latest change tag v1.0
What I need is to generate archive for v2.0 and automatically insert "v2.0" in each file, even if it hasn't been changed under 2.0 changeset.
Upvotes: 0
Views: 669
Reputation: 78330
This is better done in your build/packaging/release system not in your source control system. Since you're using hg archive
(great choice) then theres a .hg_archive.txt
file that's available to your packaging scripts or you can pass it to your release script as a parameter.
You're better off putting something like VERSION_GOES_HERE
in your files and when you're archiving do:
LATEST_TAG="$(hg log --template '{latesttag}' -r)"
perl -pie "s/VERSION_GOES_HERE/${LATEST_TAG"
Upvotes: 2