Show More
@@ -72,6 +72,15 b' def readlocaltags(ui, repo, alltags, tag' | |||||
72 | filetags = _readtags( |
|
72 | filetags = _readtags( | |
73 | ui, repo, data.splitlines(), "localtags", |
|
73 | ui, repo, data.splitlines(), "localtags", | |
74 | recode=encoding.fromlocal) |
|
74 | recode=encoding.fromlocal) | |
|
75 | ||||
|
76 | # remove tags pointing to invalid nodes | |||
|
77 | cl = repo.changelog | |||
|
78 | for t in filetags.keys(): | |||
|
79 | try: | |||
|
80 | cl.rev(filetags[t][0]) | |||
|
81 | except (LookupError, ValueError): | |||
|
82 | del filetags[t] | |||
|
83 | ||||
75 | _updatetags(filetags, "local", alltags, tagtypes) |
|
84 | _updatetags(filetags, "local", alltags, tagtypes) | |
76 |
|
85 | |||
77 | def _readtags(ui, repo, lines, fn, recode=None): |
|
86 | def _readtags(ui, repo, lines, fn, recode=None): |
@@ -907,3 +907,15 b' Test that a local tag blocks a changeset' | |||||
907 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
907 | date: Thu Jan 01 00:00:00 1970 +0000 | |
908 | summary: A |
|
908 | summary: A | |
909 |
|
909 | |||
|
910 | Test that removing a local tag does not cause some commands to fail | |||
|
911 | ||||
|
912 | $ hg tag -l -r tip tiptag | |||
|
913 | $ hg tags | |||
|
914 | tiptag 2:3816541e5485 | |||
|
915 | tip 2:3816541e5485 | |||
|
916 | visible 0:193e9254ce7e | |||
|
917 | $ hg --config extensions.strip= strip -r tip --no-backup | |||
|
918 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |||
|
919 | $ hg tags | |||
|
920 | visible 0:193e9254ce7e | |||
|
921 | tip 0:193e9254ce7e |
General Comments 0
You need to be logged in to leave comments.
Login now