tags: avoid generating commit for an already deleted tag (issue5752)
ClosedPublic

Authored by navaneeth.suresh on Jan 31 2019, 8:30 AM.

Details

Summary

$ 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.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
durin42 requested changes to this revision.Jan 31 2019, 11:27 AM
durin42 added a subscriber: durin42.
durin42 added inline comments.
mercurial/localrepo.py
1484 ↗(On Diff #13641)

You'll need to update the repository interface here: https://www.mercurial-scm.org/repo/hg-committed/file/1aa52287973e/mercurial/repository.py#l1525

That should fix your test failure.

This revision now requires changes to proceed.Jan 31 2019, 11:27 AM

Since the tag command's code is already looking at repo.tagtype(), I wonder if it would be better to just inline the global tag lookup and nullid comparison right there instead of updating the interface.

navaneeth.suresh edited the summary of this revision. (Show Details)

@durin42 Thanks for the quick review.
@mharbison72 Yup. I should not be making changes to the ui as this can be fixed simply within the call itself. My bad. I've updated the revision as per your suggestion, many thanks!

This revision was automatically updated to reflect the committed changes.