comparison mercurial/localrepo.py @ 14499:a281981e2033 stable

localrepo: ignore tags to unknown nodes (issue2750)
author Idan Kamara <idankk86@gmail.com>
date Mon, 04 Apr 2011 22:51:10 +0300
parents 4d958d1bb072
children e880433a2e00
comparison
equal deleted inserted replaced
14498:4d958d1bb072 14499:a281981e2033
359 # writing to the cache), but the rest of Mercurial wants them in 359 # writing to the cache), but the rest of Mercurial wants them in
360 # local encoding. 360 # local encoding.
361 tags = {} 361 tags = {}
362 for (name, (node, hist)) in alltags.iteritems(): 362 for (name, (node, hist)) in alltags.iteritems():
363 if node != nullid: 363 if node != nullid:
364 tags[encoding.tolocal(name)] = node 364 try:
365 # ignore tags to unknown nodes
366 self.changelog.lookup(node)
367 tags[encoding.tolocal(name)] = node
368 except error.LookupError:
369 pass
365 tags['tip'] = self.changelog.tip() 370 tags['tip'] = self.changelog.tip()
366 tagtypes = dict([(encoding.tolocal(name), value) 371 tagtypes = dict([(encoding.tolocal(name), value)
367 for (name, value) in tagtypes.iteritems()]) 372 for (name, value) in tagtypes.iteritems()])
368 return (tags, tagtypes) 373 return (tags, tagtypes)
369 374