memctx: always use cache for filectxfn
I don't see a downside to doing this unless I'm missing something.
Thanks to foozy for correcting my previous bad logic.
--- 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, [])