comparison mercurial/context.py @ 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 041d976b662a
children add613cddcb6
comparison
equal deleted inserted replaced
32780:5e76a07e9f42 32781:448fc659a430
2104 if branch is not None: 2104 if branch is not None:
2105 self._extra['branch'] = encoding.fromlocal(branch) 2105 self._extra['branch'] = encoding.fromlocal(branch)
2106 self.substate = {} 2106 self.substate = {}
2107 2107
2108 if isinstance(filectxfn, patch.filestore): 2108 if isinstance(filectxfn, patch.filestore):
2109 self._filectxfn = memfilefrompatch(filectxfn) 2109 filectxfn = memfilefrompatch(filectxfn)
2110 elif not callable(filectxfn): 2110 elif not callable(filectxfn):
2111 # if store is not callable, wrap it in a function 2111 # if store is not callable, wrap it in a function
2112 self._filectxfn = memfilefromctx(filectxfn) 2112 filectxfn = memfilefromctx(filectxfn)
2113 else: 2113
2114 # memoizing increases performance for e.g. vcs convert scenarios. 2114 # memoizing increases performance for e.g. vcs convert scenarios.
2115 self._filectxfn = makecachingfilectxfn(filectxfn) 2115 self._filectxfn = makecachingfilectxfn(filectxfn)
2116 2116
2117 if editor: 2117 if editor:
2118 self._text = editor(self._repo, self, []) 2118 self._text = editor(self._repo, self, [])
2119 self._repo.savecommitmessage(self._text) 2119 self._repo.savecommitmessage(self._text)
2120 2120