Tag keyword (keyword extension)

Martin Geisler mg at daimi.au.dk
Sun Jul 13 04:10:45 CDT 2008


Benno Dielmann <lists at benno-dielmann.de> writes:

> Another issue: When I do 
>
> $ hg tag "v0.1.1"
>
> and 
>
> $ hg log
> changeset:   15:41ef68337479
> user:        Benno Dielmann <mail at benno-dielmann.de>
> date:        Sun Jul 13 00:12:03 2008 +0200
> summary:     Added tag v0.1.1 for changeset b96acc0afdd5
>
> changeset:   14:b96acc0afdd5
> tag:         v0.1.1
> user:        Benno Dielmann <mail at benno-dielmann.de>
> date:        Sun Jul 13 00:11:54 2008 +0200
> summary:     Tag und Revisionsnummer werden im Fenstertitel angezeigt
>
> ...
>
> the $Revision$ still expands to b96acc0afdd5. Shouldn't it be
> 41ef68337479? Other revisions work well, but changesets caused by
> tagging always evaluate to one changeset before the actual parent.
> Is this a bug or a feature?

It's a feature :-) The effect you see is simply the result of how tags
are implemented in Mercurial: they are just recorded in a .hgtags file
which is versioned like any other file.

The file contains (changeset, tag) pairs, one on each line. When you
create a new tag a new line is added to the file which is then
committed. That unfortunately means that the tag for revision 14
becomes effective in revision 15 (when .hgtags was committed).

But on the other hand it makes it possible for you to delete or change
the tag at a later date.

-- 
Martin Geisler

VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multi-Party Computation) to Python. See: http://viff.dk/.


More information about the Mercurial mailing list