comparison mercurial/localrepo.py @ 3497:3464f5e77f34

Minor tags optimization
author Matt Mackall <mpm@selenic.com>
date Wed, 18 Oct 2006 22:38:23 -0500
parents baa271270829
children ff06fe0703ef
comparison
equal deleted inserted replaced
3496:baa271270829 3497:3464f5e77f34
243 # read the tags file from each head, ending with the tip, 243 # read the tags file from each head, ending with the tip,
244 # and add each tag found to the map, with "newer" ones 244 # and add each tag found to the map, with "newer" ones
245 # taking precedence 245 # taking precedence
246 heads = self.heads() 246 heads = self.heads()
247 heads.reverse() 247 heads.reverse()
248 fl = self.file(".hgtags") 248 seen = {}
249 for node in heads: 249 for node in heads:
250 f = self.filectx('.hgtags', node) 250 f = self.filectx('.hgtags', node)
251 if not f: continue 251 if not f or f.filerev() in seen: continue
252 seen[f.filerev()] = 1
252 count = 0 253 count = 0
253 for l in f.data().splitlines(): 254 for l in f.data().splitlines():
254 count += 1 255 count += 1
255 parsetag(l, _("%s, line %d") % (str(f), count)) 256 parsetag(l, _("%s, line %d") % (str(f), count))
257
256 try: 258 try:
257 f = self.opener("localtags") 259 f = self.opener("localtags")
258 count = 0 260 count = 0
259 for l in f: 261 for l in f:
260 count += 1 262 count += 1