# HG changeset patch # User timeless@gmail.com # Date 1472230665 0 # Node ID c413e7c96265ef8e247cdac002d90e0113444994 # Parent fe76e9c92fff80f956dd92e10b177ec2a9bb8c4d init: guard _namemap with repo.topics (issue5351) This prevents reading extra data on all repo commits when there is no topic for a given name. _namemap is called a lot, and it is often called for commit shas -- which should pretty much never be names of topics... diff -r fe76e9c92fff -r c413e7c96265 hgext3rd/topic/__init__.py --- a/hgext3rd/topic/__init__.py Fri Aug 26 16:52:02 2016 +0000 +++ b/hgext3rd/topic/__init__.py Fri Aug 26 16:57:45 2016 +0000 @@ -84,6 +84,8 @@ msg = _('cannot resolve "%s": topic "%s" has only %d changesets') raise error.Abort(msg % (name, topic, len(revs))) return [repo[r].node()] + if not name in repo.topics: + return [] return [ctx.node() for ctx in repo.set('not public() and extra(topic, %s)', name)]