# HG changeset patch # User Idan Kamara # Date 2011-04-04 19:51:10 # Node ID 31d15f76163120e5ef4a5c01dcd3ae94244545fa # Parent 1bd9f3a6a0d00cdcfc751b470456d25fb14d240b localrepo: ignore tags to unknown nodes (issue2750) diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -362,7 +362,12 @@ class localrepository(repo.repository): tags = {} for (name, (node, hist)) in alltags.iteritems(): if node != nullid: - tags[encoding.tolocal(name)] = node + try: + # ignore tags to unknown nodes + self.changelog.lookup(node) + tags[encoding.tolocal(name)] = node + except error.LookupError: + pass tags['tip'] = self.changelog.tip() tagtypes = dict([(encoding.tolocal(name), value) for (name, value) in tagtypes.iteritems()])