diff -r 5e76a07e9f42 -r 448fc659a430 mercurial/context.py --- a/mercurial/context.py Sat Jun 10 00:06:57 2017 -0400 +++ b/mercurial/context.py Sat Jun 10 16:00:18 2017 -0700 @@ -2106,13 +2106,13 @@ self.substate = {} if isinstance(filectxfn, patch.filestore): - self._filectxfn = memfilefrompatch(filectxfn) + filectxfn = memfilefrompatch(filectxfn) elif not callable(filectxfn): # if store is not callable, wrap it in a function - self._filectxfn = memfilefromctx(filectxfn) - else: - # memoizing increases performance for e.g. vcs convert scenarios. - self._filectxfn = makecachingfilectxfn(filectxfn) + filectxfn = memfilefromctx(filectxfn) + + # memoizing increases performance for e.g. vcs convert scenarios. + self._filectxfn = makecachingfilectxfn(filectxfn) if editor: self._text = editor(self._repo, self, [])