Skip to content
Snippets Groups Projects
Commit cb95716d authored by Katsunori FUJIWARA's avatar Katsunori FUJIWARA
Browse files

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)
parent fcf08023
No related branches found
No related tags found
No related merge requests found
......@@ -132,5 +132,7 @@
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
......@@ -135,6 +137,5 @@
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
......
......@@ -381,4 +381,26 @@
localtag 0:bbd179dfa0a7 local
globaltag 0:bbd179dfa0a7
Test for issue3911
$ hg tag -r 0 -l localtag2
$ hg tag -l --remove localtag2
$ hg tags -v
tip 1:a0b6fe111088
localtag 0:bbd179dfa0a7 local
globaltag 0:bbd179dfa0a7
$ hg tag -r 1 -f localtag
$ hg tags -v
tip 2:5c70a037bb37
localtag 1:a0b6fe111088
globaltag 0:bbd179dfa0a7
$ hg tag -r 1 localtag2
$ hg tags -v
tip 3:bbfb8cd42be2
localtag2 1:a0b6fe111088
localtag 1:a0b6fe111088
globaltag 0:bbd179dfa0a7
$ cd ..
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment