# HG changeset patch # User Patrick Mezard # Date 2012-08-15 20:50:23 # Node ID 1310489eb5d6e4b730638220591f3f8eb1eefe9c # Parent 3fe1995793237edb95224c862d58e2cd61b027a6 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. diff --git a/mercurial/fileset.py b/mercurial/fileset.py --- a/mercurial/fileset.py +++ b/mercurial/fileset.py @@ -485,7 +485,7 @@ def getfileset(ctx, expr): subset.extend(c) else: status = None - subset = ctx.walk(ctx.match([])) + subset = list(ctx.walk(ctx.match([]))) return getset(matchctx(ctx, subset, status), tree) diff --git a/tests/test-cat.t b/tests/test-cat.t --- a/tests/test-cat.t +++ b/tests/test-cat.t @@ -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 + diff --git a/tests/test-fileset.t b/tests/test-fileset.t --- a/tests/test-fileset.t +++ b/tests/test-fileset.t @@ -222,4 +222,7 @@ Test with a revision sub $ fileset -r4 'subrepo("sub")' sub + $ fileset -r4 'b2 or c1' + b2 + c1