Improve performance of looking up some SCMTool flags.
Review Request #11131 — Created Aug. 10, 2020 and submitted
We had some call sites that inspected flags on a repository's
SCMTool
,
in order to handle some logic or relay capabilities elsewhere. Some of
these call sites were fetching the tool directly, in some cases
instantiating it, and then accessing the flags. For instance, there were
many blocks of code accessingSCMTool.diffs_use_absolute_paths
inefficiently.We already had wrappers in
Repository
for accessing some of these
flags, which was more efficient. These looked up by class when possible,
instantiating only if necessary. In other cases, the flags could be
looked up on the class, rather than needing an instance.This change updates all references to use the wrappers in the
Repository
. It also makes theRepository.diffs_use_absolute_paths
wrapper properly acached_property
, to avoid repeated lookups and
instantiations.
Unit tests pass.
Summary | ID |
---|---|
000c395de9624ec45498fb268ef9472506be314b |