fileset: fix generator vs list bug in fast path stable
authorPatrick Mezard <patrick@mezard.eu>
Wed, 15 Aug 2012 22:50:23 +0200
branchstable
changeset 17371 1310489eb5d6
parent 17370 3fe199579323
child 17372 ff3c89cf1477
child 17379 7228def3dcc1
fileset: fix generator vs list bug in fast path $ hg debugfileset 'a or b' would only return a or b but not both because the base file list was a generator instead of a replayable sequence.
mercurial/fileset.py
tests/test-cat.t
tests/test-fileset.t
--- a/mercurial/fileset.py	Wed Aug 15 22:28:32 2012 +0200
+++ b/mercurial/fileset.py	Wed Aug 15 22:50:23 2012 +0200
@@ -485,7 +485,7 @@
             subset.extend(c)
     else:
         status = None
-        subset = ctx.walk(ctx.match([]))
+        subset = list(ctx.walk(ctx.match([])))
 
     return getset(matchctx(ctx, subset, status), tree)
 
--- a/tests/test-cat.t	Wed Aug 15 22:28:32 2012 +0200
+++ b/tests/test-cat.t	Wed Aug 15 22:50:23 2012 +0200
@@ -21,3 +21,14 @@
   [1]
   $ hg cat -r 1 b
   1
+
+Test fileset
+
+  $ echo 3 > c
+  $ hg ci -Am addmore c
+  $ hg cat 'set:not(b) or a'
+  3
+  $ hg cat 'set:c or b'
+  1
+  3
+
--- a/tests/test-fileset.t	Wed Aug 15 22:28:32 2012 +0200
+++ b/tests/test-fileset.t	Wed Aug 15 22:50:23 2012 +0200
@@ -222,4 +222,7 @@
   sub
   $ fileset -r4 'subrepo("sub")'
   sub
+  $ fileset -r4 'b2 or c1'
+  b2
+  c1