Show More
@@ -290,9 +290,25 b' class localrepository(repo.repository):' | |||||
290 | globaltags[k] = an, ah |
|
290 | globaltags[k] = an, ah | |
291 | tagtypes[k] = tagtype |
|
291 | tagtypes[k] = tagtype | |
292 |
|
292 | |||
|
293 | def tagnodes(): | |||
|
294 | last = {} | |||
|
295 | ret = [] | |||
|
296 | for node in reversed(self.heads()): | |||
|
297 | c = self[node] | |||
|
298 | rev = c.rev() | |||
|
299 | try: | |||
|
300 | fnode = c.filenode('.hgtags') | |||
|
301 | except error.LookupError: | |||
|
302 | continue | |||
|
303 | ret.append((rev, node, fnode)) | |||
|
304 | if fnode in last: | |||
|
305 | ret[last[fnode]] = None | |||
|
306 | last[fnode] = len(ret) - 1 | |||
|
307 | return [item for item in ret if item] | |||
|
308 | ||||
293 | # read the tags file from each head, ending with the tip |
|
309 | # read the tags file from each head, ending with the tip | |
294 | f = None |
|
310 | f = None | |
295 |
for rev, node, fnode in |
|
311 | for rev, node, fnode in tagnodes(): | |
296 | f = (f and f.filectx(fnode) or |
|
312 | f = (f and f.filectx(fnode) or | |
297 | self.filectx('.hgtags', fileid=fnode)) |
|
313 | self.filectx('.hgtags', fileid=fnode)) | |
298 | readtags(f.data().splitlines(), f, "global") |
|
314 | readtags(f.data().splitlines(), f, "global") | |
@@ -328,22 +344,6 b' class localrepository(repo.repository):' | |||||
328 |
|
344 | |||
329 | return self._tagstypecache.get(tagname) |
|
345 | return self._tagstypecache.get(tagname) | |
330 |
|
346 | |||
331 | def _hgtagsnodes(self): |
|
|||
332 | last = {} |
|
|||
333 | ret = [] |
|
|||
334 | for node in reversed(self.heads()): |
|
|||
335 | c = self[node] |
|
|||
336 | rev = c.rev() |
|
|||
337 | try: |
|
|||
338 | fnode = c.filenode('.hgtags') |
|
|||
339 | except error.LookupError: |
|
|||
340 | continue |
|
|||
341 | ret.append((rev, node, fnode)) |
|
|||
342 | if fnode in last: |
|
|||
343 | ret[last[fnode]] = None |
|
|||
344 | last[fnode] = len(ret) - 1 |
|
|||
345 | return [item for item in ret if item] |
|
|||
346 |
|
||||
347 | def tagslist(self): |
|
347 | def tagslist(self): | |
348 | '''return a list of tags ordered by revision''' |
|
348 | '''return a list of tags ordered by revision''' | |
349 | l = [] |
|
349 | l = [] |
General Comments 0
You need to be logged in to leave comments.
Login now