diff mercurial/tags.py @ 19108:cb95716da5fe stable

tags: update tag type only if tag node is updated (issue3911) Before this patch, tag type information is always updated, even if tag previously read in has higher priority than one newly read in. This causes that the tag type is displayed as "local", even if global tag overwrites existing local one successfully. This patch updates tag type only if tag node is updated. This patch tests overwriting local tags below: - visible one (normal case) - already removed one (recorded as null)
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Tue, 30 Apr 2013 09:02:02 +0900
parents e7cfe3587ea4
children 335a558f81dc
line wrap: on
line diff
--- a/mercurial/tags.py	Tue Apr 30 01:04:35 2013 +0200
+++ b/mercurial/tags.py	Tue Apr 30 09:02:02 2013 +0900
@@ -132,9 +132,10 @@
         if (bnode != anode and anode in bhist and
             (bnode not in ahist or len(bhist) > len(ahist))):
             anode = bnode
+        else:
+            tagtypes[name] = tagtype
         ahist.extend([n for n in bhist if n not in ahist])
         alltags[name] = anode, ahist
-        tagtypes[name] = tagtype
 
 
 # The tag cache only stores info about heads, not the tag contents