Manually adding tags
Isaac Jurado
diptongo at gmail.com
Fri Aug 26 08:23:19 UTC 2011
On Fri, Aug 26, 2011 at 12:11 AM, Harvey Chapman <hchapman-hg at 3gfp.com> wrote:
>
> Is there any reason why I shouldn't manually add (and only add) tags
> (by machine-editing the .hgtags file)? Currently, I have a build
> script that adds a tag and then updates a file with the next version
> number to come. It then commits that file. I'm thinking of combining
> the two steps to keep the log shorter and people get confused now when
> they see the next version number in a commit message. I wouldn't feel
> like I needed to put the next version number in the commit message if
> I combined the two changes.
If I understood correctly, you wan to tag a changeset you are about to
commit, right? If that is the case, you can forget about it because the
.hgtags file needs the revision ID (the SHA) which you can't know until
AFTER commit has been done. So there is a bootstrapping problem.
Besides, the "hg tag" command is just that:
$ echo "version shaid" >>.hgtags && hg commit
You may want to check the "{latesttag}" template keyword, if you want to
integrate tag versioning at deploy time without having to update back to
the desired tag first.
$ hg help templates
$ hg log --template "{latesttag}" -r .
Cheers.
--
Isaac Jurado
"The noblest pleasure is the joy of understanding"
Leonardo da Vinci
More information about the Mercurial
mailing list