changeset 17371:1310489eb5d6 stable

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.
author Patrick Mezard <patrick@mezard.eu>
date Wed, 15 Aug 2012 22:50:23 +0200
parents 3fe199579323
children ff3c89cf1477 7228def3dcc1
files mercurial/fileset.py tests/test-cat.t tests/test-fileset.t
diffstat 3 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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