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
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 accessing
We already had wrappers in
Repositoryfor 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 the
wrapper properly a
cached_property, to avoid repeated lookups and
Unit tests pass.