diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -1330,6 +1330,11 @@ p = p[:-1] return [changectx(self._repo, x) for x in p] + def _fileinfo(self, path): + # populate __dict__['_manifest'] as workingctx has no _manifestdelta + self._manifest + return super(workingctx, self)._fileinfo(path) + def filectx(self, path, filelog=None): """get a file context from the working directory""" return workingfilectx(self._repo, path, workingctx=self, diff --git a/tests/test-grep.t b/tests/test-grep.t --- a/tests/test-grep.t +++ b/tests/test-grep.t @@ -237,6 +237,17 @@ $ hg grep -f port [1] +Test wdir +(at least, this shouldn't crash) + + $ hg up -q + $ echo wport >> port2 + $ hg stat + M port2 + $ hg grep -r 'wdir()' port + abort: data/port2.i@303030303030: no node! + [255] + $ cd .. $ hg init t2 $ cd t2