Bug 3911 - forced global tag wrongly listed as overwriting localtag
Summary: forced global tag wrongly listed as overwriting localtag
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: earlier
Hardware: PC Mac OS
: normal bug
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-27 15:22 UTC by Kevin Bullock
Modified: 2017-11-01 18:04 UTC (History)
2 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Bullock 2013-04-27 15:22 UTC
Local tags generally override global tags of the same name[1]. But if you have an existing localtag, and then create (with --force) a global tag with the same name, the global tag will be listed in 'hg tags'. Worse, it will be listed as a _local_ tag in 'hg tags -v'.

[1]: http://selenic.com/pipermail/mercurial-devel/2013-April/050847.html

To reproduce:

$ hg init a && cd a
$ echo a>a
$ hg ci -Am0
$ hg tag -l t0
$ echo b>a
$ hg ci -m1
$ hg tag -f t1
$ hg tags -v
tip                                2:18555d753664
t0                                 1:f623ad5141d6 local
#                                  ^^^ WAT
$ hg up -q t0
$ hg sum
parent: 0:ab6e289ce0b3 t0
0
branch: default
commit: (clean)
update: 2 new changesets (update)
$ hg up -q
$ hg tags -v
tip                                2:18555d753664
t0                                 0:ab6e289ce0b3 local
#                                  ^^^ double-WAT
Comment 1 HG Bot 2013-05-01 16:00 UTC
Fixed by http://selenic.com/repo/hg/rev/cb95716da5fe
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
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)

(please test the fix)