multiple tags for a changeset (was Re: jdk7/MASTER/hotspot: 2 new changesets)

John Coomes John.Coomes at
Fri Nov 16 22:58:47 UTC 2007

Kelly O'Hair (Kelly.Ohair at Sun.COM) wrote:
> Actually, by having these be separate changesets, if you ask for the
> tag "ea" you get a repository that includes the "jdk7-b98" tag but not
> the changeset that creates the "ea" tag.

And that's not confusing?

> Making them in one changeset means the same sources, but no changeset
> identifying it as jdk7-b98 or ea.

The "missing tag" is a limitation that's mentioned in the mercurial
book:  whenever you "hg clone -r tag" the newly-created repo doesn't
include the tag you requested.  However, if you "hg update -r tag"
(likely my preferred method), the tag is visible.

With either scheme (one changeset or different changesets), if you
want to verify that "ea" and "jdk7-b98" are the same thing, you can't
do it in the clone, you have to go to the original repo.  It's just
more tedious to do when the two names refer to different changesets.

> Also, 'hg tag -f' was used to force the replacement of any older tags
> with the same name that might exist. Not sure your script deal with that.

That's part of the "error checking and polish" that I conveniently
left out :-).  The script is a hack to workaround "hg tag" not
accepting multiple tag names.  I'd prefer to fix hg tag, but can't do
that yet.

> Not sure it matters a great deal either way.

The moon won't fall out of the sky.  But I think it's less confusing
if different names for the same thing actually refer to the, um, same


> John Coomes wrote:
> > Xiomara.Jayasena at Sun.COM (Xiomara.Jayasena at Sun.COM) wrote:
> >> Changeset: 38b77760d8e2
> >> Author:    xdono
> >> Date:      2007-11-15 17:12 -0800
> >> URL:
> >>
> >> Added tag jdk7-b98 for changeset 280051e520a0
> >>
> >> + .hgtags
> >>
> >> Changeset: de9a59a5e8da
> >> Author:    xdono
> >> Date:      2007-11-15 17:21 -0800
> >> URL:
> >>
> >> Added tag ea for changeset 38b77760d8e2
> >>
> >> ! .hgtags
> > 
> > In this case, the tags represent the same thing, but they refer to
> > different changesets.  Seems like they should refer to the same
> > changeset.  In addition, you get two changesets instead of one for a
> > trivial operation.
> > 
> > Unfortunately, "hg tag" only allows one tag to be created per
> > invocation.  (Seems ripe for a fix, but I'm currently
> > python-illiterate.)  So for now I think this should be done by
> > updating .hgtags directly.  Here's a script that does the basics; it
> > needs error checking and polish, but you get the idea.
> > 
> > 	#!/bin/ksh
> > 	hg_short=`hg log -l 1 --template "{node|short}"`
> > 	hg_node=`hg log -r $hg_short --template "{node}"`
> > 	for tag
> > 	do
> > 		echo $hg_node "$tag"
> > 	done >> .hgtags
> > 	hg commit -m "Added tags $* for changeset $hg_short"
> > 
> > -John
> > 

More information about the build-dev mailing list