diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -717,16 +717,15 @@ def filelog(repo, subset, x): # i18n: "filelog" is a keyword pat = getstring(x, _("filelog requires a pattern")) - m = matchmod.match(repo.root, repo.getcwd(), [pat], default='relpath', - ctx=repo[None]) s = set() if not matchmod.patkind(pat): - f = m.files()[0] + f = pathutil.canonpath(repo.root, repo.getcwd(), pat) fl = repo.file(f) for fr in fl: s.add(fl.linkrev(fr)) else: + m = matchmod.match(repo.root, repo.getcwd(), [pat], ctx=repo[None]) for f in repo[None]: if m(f): fl = repo.file(f) diff --git a/tests/test-revset.t b/tests/test-revset.t --- a/tests/test-revset.t +++ b/tests/test-revset.t @@ -292,6 +292,12 @@ ancestor can accept 0 or more arguments $ log 'file("b*")' 1 4 + $ log 'filelog("b")' + 1 + 4 + $ log 'filelog("../repo/b")' + 1 + 4 $ log 'follow()' 0 1