##// END OF EJS Templates
tags: do not feed dictionaries to 'findglobaltags'...
Pierre-Yves David -
r31706:63d4deda default
parent child Browse files
Show More
@@ -707,10 +707,11 b' class localrepository(object):'
707 707 # be one tagtype for all such "virtual" tags? Or is the status
708 708 # quo fine?
709 709
710 alltags = {} # map tag name to (node, hist)
711 tagtypes = {}
712 710
713 tagsmod.findglobaltags(self.ui, self, alltags, tagtypes)
711 globaldata = tagsmod.findglobaltags(self.ui, self)
712 alltags = globaldata[0] # map tag name to (node, hist)
713 tagtypes = globaldata[1] # map tag name to tag type
714
714 715 tagsmod.readlocaltags(self.ui, self, alltags, tagtypes)
715 716
716 717 # Build the return dicts. Have to re-encode tag names because
@@ -78,23 +78,18 b' from . import ('
78 78 # The most recent changeset (in terms of revlog ordering for the head
79 79 # setting it) for each tag is last.
80 80
81 def findglobaltags(ui, repo, alltags, tagtypes):
82 '''Find global tags in a repo.
81 def findglobaltags(ui, repo):
82 '''Find global tags in a repo: return (alltags, tagtypes)
83 83
84 84 "alltags" maps tag name to (node, hist) 2-tuples.
85 85
86 86 "tagtypes" maps tag name to tag type. Global tags always have the
87 87 "global" tag type.
88 88
89 The "alltags" and "tagtypes" dicts are updated in place. Empty dicts
90 should be passed in.
91
92 89 The tags cache is read and updated as a side-effect of calling.
93 90 '''
94 # This is so we can be lazy and assume alltags contains only global
95 # tags when we pass it to _writetagcache().
96 assert len(alltags) == len(tagtypes) == 0, \
97 "findglobaltags() should be called first"
91 alltags = {}
92 tagtypes = {}
98 93
99 94 (heads, tagfnode, valid, cachetags, shouldwrite) = _readtagcache(ui, repo)
100 95 if cachetags is not None:
@@ -103,7 +98,7 b' def findglobaltags(ui, repo, alltags, ta'
103 98 # cases where a global tag should outrank a local tag but won't,
104 99 # because cachetags does not contain rank info?
105 100 _updatetags(cachetags, 'global', alltags, tagtypes)
106 return
101 return alltags, tagtypes
107 102
108 103 seen = set() # set of fnode
109 104 fctx = None
@@ -125,6 +120,7 b' def findglobaltags(ui, repo, alltags, ta'
125 120 # and update the cache (if necessary)
126 121 if shouldwrite:
127 122 _writetagcache(ui, repo, valid, alltags)
123 return alltags, tagtypes
128 124
129 125 def readlocaltags(ui, repo, alltags, tagtypes):
130 126 '''Read local tags in repo. Update alltags and tagtypes.'''
General Comments 0
You need to be logged in to leave comments. Login now