##// END OF EJS Templates
tags: make argument 'tagtype' optional in '_updatetags'...
Pierre-Yves David -
r31708:d0e7c70f default
parent child Browse files
Show More
@@ -223,15 +223,22 b' def _readtags(ui, repo, lines, fn, recod'
223 newtags[tag] = (taghist[-1], taghist[:-1])
223 newtags[tag] = (taghist[-1], taghist[:-1])
224 return newtags
224 return newtags
225
225
226 def _updatetags(filetags, alltags, tagtype, tagtypes):
226 def _updatetags(filetags, alltags, tagtype=None, tagtypes=None):
227 '''Incorporate the tag info read from one file into the two
227 """Incorporate the tag info read from one file into dictionnaries
228 dictionaries, alltags and tagtypes, that contain all tag
228
229 info (global across all heads plus local).'''
229 The first one, 'alltags', is a "tagmaps" (see 'findglobaltags' for details).
230
231 The second one, 'tagtypes', is optional and will be updated to track the
232 "tagtype" of entries in the tagmaps. When set, the 'tagtype' argument also
233 needs to be set."""
234 if tagtype is None:
235 assert tagtypes is None
230
236
231 for name, nodehist in filetags.iteritems():
237 for name, nodehist in filetags.iteritems():
232 if name not in alltags:
238 if name not in alltags:
233 alltags[name] = nodehist
239 alltags[name] = nodehist
234 tagtypes[name] = tagtype
240 if tagtype is not None:
241 tagtypes[name] = tagtype
235 continue
242 continue
236
243
237 # we prefer alltags[name] if:
244 # we prefer alltags[name] if:
@@ -243,7 +250,7 b' def _updatetags(filetags, alltags, tagty'
243 if (bnode != anode and anode in bhist and
250 if (bnode != anode and anode in bhist and
244 (bnode not in ahist or len(bhist) > len(ahist))):
251 (bnode not in ahist or len(bhist) > len(ahist))):
245 anode = bnode
252 anode = bnode
246 else:
253 elif tagtype is not None:
247 tagtypes[name] = tagtype
254 tagtypes[name] = tagtype
248 ahist.extend([n for n in bhist if n not in ahist])
255 ahist.extend([n for n in bhist if n not in ahist])
249 alltags[name] = anode, ahist
256 alltags[name] = anode, ahist
General Comments 0
You need to be logged in to leave comments. Login now