diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -1227,7 +1227,8 @@ unknown=True, ignored=False)) def matches(self, match): - return sorted(self._repo.dirstate.matches(match)) + ds = self._repo.dirstate + return sorted(f for f in ds.matches(match) if ds[f] != 'r') def ancestors(self): for p in self._parents: diff --git a/tests/test-command-template.t b/tests/test-command-template.t --- a/tests/test-command-template.t +++ b/tests/test-command-template.t @@ -4344,6 +4344,12 @@ 0 + $ hg rm a + $ hg log -r "wdir()" -T "{rev}\n{join(files('*'), '\n')}\n" + 2147483647 + aa + b + $ hg revert a Test relpath function