mercurial/revset.py
branchstable
changeset 15325 cdf1daa3b83f
parent 15268 bd5103819c2e
child 15326 8ae2900d6d9b
--- a/mercurial/revset.py	Fri Oct 21 12:07:27 2011 +0100
+++ b/mercurial/revset.py	Fri Oct 21 12:12:21 2011 -0500
@@ -1068,6 +1068,8 @@
     '(10 or 11):: and ((this()) or (that()))'
     >>> formatspec('%d:: and not %d::', 10, 20)
     '10:: and not 20::'
+    >>> formatspec('%ld or %ld', [], [1])
+    '(0-0) or (1)'
     >>> formatspec('keyword(%s)', 'foo\\xe9')
     "keyword('foo\\\\xe9')"
     >>> b = lambda: 'default'
@@ -1111,7 +1113,10 @@
                 # a list of some type
                 pos += 1
                 d = expr[pos]
-                lv = ' or '.join(argtype(d, e) for e in args[arg])
+                if args[arg]:
+                    lv = ' or '.join(argtype(d, e) for e in args[arg])
+                else:
+                    lv = '0-0' # a minimal way to represent an empty set
                 ret += '(%s)' % lv
                 arg += 1
             else: