Peter Hull
Peter Hull

Reputation: 7067

Mercurial: change tag from local to global

I wanted to change a tag from being local to global by deleting and recreating it, but the global tag is not shown.

What I did was: (at the tip of the repository)

hg tag -l v1

(some time later, still at tip, no more commits have been made)

hg tag -l --remove v1
hg tag v1

Now tag v1 does not appear in hg tags output; Mercurial has committed 2 lines to .hgtags, one with a revision number of all zeros, which indicates a deleted tag.

I solved this by editing .hg/localtags to remove all reference to v1 before hg tag v1. I could have edited .hgtags and re-committed but that would have left evidence of my incompetence (!!). Is there a correct way of doing this?

Upvotes: 2

Views: 435

Answers (1)

Martin Geisler
Martin Geisler

Reputation: 73778

Nope, you've found a bug in how Mercurial computes the tags! I think the work-around you've found is the only current solution.

I've entered this as Issue3338 in our bug tracker.

Upvotes: 1

Related Questions