Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commands.py @ 41504:09f1c17e24dd
tags: avoid generating commit for an already deleted tag (issue5752)
`$ hg tag --remove <tagname>` will keep on generating commits
regardless of checking whether the tag is deleted or not. I added a
a fix for `global` tags by aborting if `nullid` is already mapped
to the tag that is to be deleted.
Differential Revision: https://phab.mercurial-scm.org/D5780
author | Navaneeth Suresh <navaneeths1998@gmail.com> |
---|---|
date | Thu, 31 Jan 2019 18:17:02 +0530 |
parents | 2ff8994ac71d |
children | e6ec0737b706 |
comparison
equal
deleted
inserted
replaced
41503:5125f0a9728b | 41504:09f1c17e24dd |
---|---|
5828 expectedtype = 'local' | 5828 expectedtype = 'local' |
5829 else: | 5829 else: |
5830 expectedtype = 'global' | 5830 expectedtype = 'global' |
5831 | 5831 |
5832 for n in names: | 5832 for n in names: |
5833 if repo.tagtype(n) == 'global': | |
5834 alltags = tagsmod.findglobaltags(ui, repo) | |
5835 if alltags[n][0] == nullid: | |
5836 raise error.Abort(_("tag '%s' is already removed") % n) | |
5833 if not repo.tagtype(n): | 5837 if not repo.tagtype(n): |
5834 raise error.Abort(_("tag '%s' does not exist") % n) | 5838 raise error.Abort(_("tag '%s' does not exist") % n) |
5835 if repo.tagtype(n) != expectedtype: | 5839 if repo.tagtype(n) != expectedtype: |
5836 if expectedtype == 'global': | 5840 if expectedtype == 'global': |
5837 raise error.Abort(_("tag '%s' is not a global tag") % n) | 5841 raise error.Abort(_("tag '%s' is not a global tag") % n) |