diff -r 33ed8b511185 -r 976e1cfb2f64 mercurial/subrepo.py --- a/mercurial/subrepo.py Thu Apr 02 23:32:28 2015 +0900 +++ b/mercurial/subrepo.py Thu Apr 02 23:28:16 2015 +0900 @@ -1642,8 +1642,7 @@ # TODO: add support for non-plain formatter (see cmdutil.cat()) for f in match.files(): output = self._gitcommand(["show", "%s:%s" % (rev, f)]) - fp = cmdutil.makefileobj(self._subparent, fntemplate, - self._ctx.node(), + fp = cmdutil.makefileobj(self._ctx, fntemplate, pathname=self.wvfs.reljoin(prefix, f)) fp.write(output) fp.close()