diff mercurial/revset.py @ 21925:7142e04b438e

revset: avoid a ValueError when 'only()' is given an empty set This previously died in _revdescendants() taking the min() of the first set to only(), when it was empty. An empty second set already worked. Likewise, descendants() already handled an empty set.
author Matt Harbison <matt_harbison@yahoo.com>
date Fri, 18 Jul 2014 19:46:56 -0400 (2014-07-18)
parents 1000348b3aea
children f486001f9d6f
line wrap: on
line diff
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -399,6 +399,9 @@
     args = getargs(x, 1, 2, _('only takes one or two arguments'))
     include = getset(repo, spanset(repo), args[0]).set()
     if len(args) == 1:
+        if len(include) == 0:
+            return baseset([])
+
         descendants = set(_revdescendants(repo, include, False))
         exclude = [rev for rev in cl.headrevs()
             if not rev in descendants and not rev in include]