revset-only: use __nonzero__ to check if a revset is empty
For some smartsets, computing length is more expensive than checking if the set
is empty.
--- a/mercurial/revset.py Wed Oct 15 12:38:47 2014 -0700
+++ b/mercurial/revset.py Wed Oct 08 02:45:21 2014 -0700
@@ -398,7 +398,7 @@
args = getargs(x, 1, 2, _('only takes one or two arguments'))
include = getset(repo, spanset(repo), args[0])
if len(args) == 1:
- if len(include) == 0:
+ if not include:
return baseset()
descendants = set(_revdescendants(repo, include, False))