Mercurial > hg
changeset 32781:448fc659a430
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.
author | Sean Farley <sean@farley.io> |
---|---|
date | Sat, 10 Jun 2017 16:00:18 -0700 |
parents | 5e76a07e9f42 |
children | 9a4adc76c88a |
files | mercurial/context.py |
diffstat | 1 files changed, 5 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- 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, [])