comparison mercurial/localrepo.py @ 31706:63d4deda1b31

tags: do not feed dictionaries to 'findglobaltags' The code asserts that these dictionary are empty. So we can be more explicit and have the function return the dictionaries directly.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Tue, 28 Mar 2017 06:13:49 +0200
parents e6fd7930cf0b
children c34c170b25f3
comparison
equal deleted inserted replaced
31705:5eb4d206202b 31706:63d4deda1b31
705 # mq and bookmarks add tags, but do not set the tagtype at all. 705 # mq and bookmarks add tags, but do not set the tagtype at all.
706 # Should each extension invent its own tag type? Should there 706 # Should each extension invent its own tag type? Should there
707 # be one tagtype for all such "virtual" tags? Or is the status 707 # be one tagtype for all such "virtual" tags? Or is the status
708 # quo fine? 708 # quo fine?
709 709
710 alltags = {} # map tag name to (node, hist) 710
711 tagtypes = {} 711 globaldata = tagsmod.findglobaltags(self.ui, self)
712 712 alltags = globaldata[0] # map tag name to (node, hist)
713 tagsmod.findglobaltags(self.ui, self, alltags, tagtypes) 713 tagtypes = globaldata[1] # map tag name to tag type
714
714 tagsmod.readlocaltags(self.ui, self, alltags, tagtypes) 715 tagsmod.readlocaltags(self.ui, self, alltags, tagtypes)
715 716
716 # Build the return dicts. Have to re-encode tag names because 717 # Build the return dicts. Have to re-encode tag names because
717 # the tags module always uses UTF-8 (in order not to lose info 718 # the tags module always uses UTF-8 (in order not to lose info
718 # writing to the cache), but the rest of Mercurial wants them in 719 # writing to the cache), but the rest of Mercurial wants them in