Josh Johnson
Josh Johnson

Reputation: 11107

Why Are Mercurial Tags Unique?

To me, the notion of a "tag" is a quick label you apply to something as an easy reminder. But you can't have a tag like that in HG because you could only have it once. You'd have to add a timestamp or such to it.

What is the reasoning behind having unique tags in HG? Is there a mechanism in HG that would allow me to find "all changesets I marked as X"?

Upvotes: 1

Views: 302

Answers (2)

user647772
user647772

Reputation:

Check out the tag docs at mercurial wiki.

Upvotes: 1

Chris Morgan
Chris Morgan

Reputation: 90782

Tags are for tagging the particular state of the repository at such-and-such a time. Version 1.0 as v1.0, and things like that. Tagging releases is the most common usage. It's not intended for "the current release"; branches are more suitable for that.

You can work with all sorts of different branching techniques; one is to have a "deployment" branch (perhaps the default branch, or called "release", or "deploy"—whatever you want) from which you make your releases. Do work in another branch or branches, and then merge into the release branch for making releases (and then, of course, you get to tag them).

I would advise you to read about branches and tags from something like Chapter 8. Managing releases and branchy development in Mercurial: The Definitive Guide.


There's no built-in way of adding "labels" to changesets. Things like hg-review (for code review—a project well worth looking at), when they want to add information to changesets, store it in their own location in their own way and link it in their own way through their own commands.

Upvotes: 3

Related Questions