# HG changeset patch # User Matt Mackall # Date 1338581585 18000 # Node ID b6ef1395d77f0ad75ca2752f296938b2ecbb3b1c # Parent f3b8c82a559cb2bc544ab42425ce54b5da553f3f revset: avoid validating all tag nodes for tag(x) This generally causes the entire node->rev table to get built when we're only interested in one node. diff -r f3b8c82a559c -r b6ef1395d77f mercurial/revset.py --- a/mercurial/revset.py Wed May 30 23:14:04 2012 +0100 +++ b/mercurial/revset.py Fri Jun 01 15:13:05 2012 -0500 @@ -1214,9 +1214,11 @@ _('the argument to tag must be a string')) kind, pattern, matcher = _stringmatcher(pattern) if kind == 'literal': - if not repo.tags().get(pattern, None): + # avoid resolving all tags + tn = repo._tagscache.tags.get(pattern, None) + if tn is None: raise util.Abort(_("tag '%s' does not exist") % pattern) - s = set([cl.rev(n) for t, n in repo.tagslist() if t == pattern]) + s = set([repo[tn].rev()]) else: s = set([cl.rev(n) for t, n in repo.tagslist() if matcher(t)]) if not s: