diff --git a/mercurial/match.py b/mercurial/match.py --- a/mercurial/match.py +++ b/mercurial/match.py @@ -48,7 +48,7 @@ def _expandsets(root, cwd, kindpats, ctx for kind, pat, source in kindpats: if kind == 'set': - if not ctx: + if ctx is None: raise error.ProgrammingError("fileset expression with no " "context") matchers.append(ctx.matchfileset(pat, badfn=badfn)) diff --git a/tests/test-locate.t b/tests/test-locate.t --- a/tests/test-locate.t +++ b/tests/test-locate.t @@ -156,6 +156,11 @@ Issue294: hg remove --after dir fails wh $ hg files . [1] +Fileset at null (i.e. a falsy context) shouldn't crash (issue6046) + + $ hg files -r null 'set:tracked()' + [1] + Convert native path separator to slash (issue5572) $ hg files -T '{path|relpath|slashpath}\n'