diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -12,6 +12,7 @@ import match as matchmod from i18n import _ import encoding import obsolete as obsmod +import pathutil import repoview def _revancestors(repo, revs, followfirst): @@ -530,6 +531,7 @@ def contains(repo, subset, x): pat = getstring(x, _("contains requires a pattern")) s = [] if not matchmod.patkind(pat): + pat = pathutil.canonpath(repo.root, repo.getcwd(), pat) for r in subset: if pat in repo[r]: s.append(r) diff --git a/tests/test-revset.t b/tests/test-revset.t --- a/tests/test-revset.t +++ b/tests/test-revset.t @@ -273,6 +273,11 @@ ancestor can accept 0 or more arguments 1 3 5 + $ log 'contains("../repo/a")' + 0 + 1 + 3 + 5 $ log 'desc(B)' 5 $ log 'descendants(2 or 3)'