tags and multiple heads

Henryk Gerlach hgerlach at gmx.net
Thu Jun 12 10:10:34 CDT 2008


Hi,

I don't understand how tags are handled in multiple heads. The wiki (http://www.selenic.com/mercurial/wiki/index.cgi/Tag) says:

The tags that are in effect at any given time are the tags specified in each head, with heads closer to the tip taking precedence. Local tags override all other tags.

But this behavoir has changed by: http://hg.xavamedia.nl/mercurial/crew/rev/e29f2db5ab18
due to http://www.selenic.com/mercurial/bts/issue498 
the implemented Algorithm seems to be discribed here http://www.selenic.com/mercurial/bts/file248/hgtagfix-gwk-take4.patch-annotated.

Can someone confrim this so I can document it in the wiki?


Plus it looks like it is not handeling the nullid-cancling(*) of tags appropriately, which IMHO causes
http://www.selenic.com/mercurial/bts/issue1102 (**)

(*) the nullid-canceling seems not to be documented in the manpage nor the wiki.

(**) It looks like truncating the tag history when encountering a nullid seems the appropiate measure:
=======================================
diff -r d1a312daa574 mercurial/localrepo.py
--- a/mercurial/localrepo.py    Wed Jun 11 18:00:58 2008 -0500
+++ b/mercurial/localrepo.py    Thu Jun 12 19:03:13 2008 +0200
@@ -260,7 +260,10 @@
                 h = []
                 if key in filetags:
                     n, h = filetags[key]
-                    h.append(n)
+                    if bin_n == nullid:
+                        h=[] #truncate history for deleted tags
+                    else:
+                        h.append(n)
                 filetags[key] = (bin_n, h)
 
             for k, nh in filetags.items():
=========================================

Best regards,

Henryk Gerlach
-- 
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger


More information about the Mercurial mailing list