Use of tags

Matt Mackall mpm at selenic.com
Mon Mar 5 12:57:13 CST 2007


On Mon, Mar 05, 2007 at 10:35:31AM -0800, Kelly O'Hair wrote:
> Does anyone have any experience with massive numbers of tags?
> They seem very lightweight, so I don't think there is an issue with
> perhaps as many tags as there are changesets, at least size wise.
> 
> I'm considering adding a tag with a change request number (bugid) to
> the global tags so that it would be easy to find the latest changeset for
> a change request or bug fix. Has anyone tried this?
> Seems like it would create a nice link between the actual changes and the
> change request or bug tracking system.

The difficulty you're likely to face is that adding a tag creates a
changeset and you probably don't want to double your number of
changesets.

However, if you manually add a large number of tags to .hgtags, you
can amortize the cost.

In terms of overhead, tags are read whenever lookup by number or cset
fails. All heads are checked for tags and the result has to fit
comfortably in memory. A .hgtags file that has 20k tags in it will
probably be ~1M, and will probably take ~1s to reconstruct (it will be
very similar to the manifest).

Also, this will create a bit of a nuisance on merge as we simply call
hgmerge and it doesn't do anything special with .hgtags.

There are probably some usability downsides in terms of finding
"normal" tags as well.

It might be more interesting to look at using extensions to tie
Mercurial more closely with your bug tracking system.

If you're recording bugids in your changelog, you should also be aware
of hg log --keyword.

-- 
Mathematics is the supreme nostalgia of our time.


More information about the Mercurial mailing list