Manually adding tags

Greg Ward greg-hg at gerg.ca
Fri Aug 26 00:09:48 UTC 2011


On Thu, Aug 25, 2011 at 6:11 PM, 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.

Adding new tags is as easy as it looks if you make sure you only have
head, or if you only modify .hgtags on one head. Removing tags or
changing tags is subtle and non-obvious. And if you modify .hgtags on
multiple heads, be careful. The closer you get to the general case --
adding, removing, and moving tags on multiple heads -- the more likely
you are to get into trouble doing it yourself. But if you stick with
adding tags on a single head, you should be fine.

Greg



More information about the Mercurial mailing list