Add a registry for managing and looking up diff tools.

Review Request #12601 — Created Sept. 14, 2022 and submitted — Latest diff uploaded

Information

RBTools
release-4.x

Reviewers

This implements DiffToolsRegistry, which tracks all available diff
tools. It can be used to look up registered tool classes and instantiate
available tool instances (which will be cached for reuse).

New tools can also be registered dynamically, though this isn't
something that will be useful outside of very specialized custom code.

When looking up available tools, it will instantiate each tool, set it
up and check for availability on the system, and then cache it.

If an available tool can't be found, a MissingDiffToolError will be
raised. This will contain a list of all tools tried, and any
instructions that candidate tools may provide.

Unit tests pass.

Used this with in-progress changes to SCMClients.

Diff Revision 2 (Latest)

orig
1
2

Commits

First Last Summary ID Author
Add a registry for managing and looking up diff tools.
This implements `DiffToolsRegistry`, which tracks all available diff tools. It can be used to look up registered tool classes and instantiate available tool instances (which will be cached for reuse). New tools can also be registered dynamically, though this isn't something that will be useful outside of very specialized custom code. When looking up available tools, it will instantiate each tool, set it up and check for availability on the system, and then cache it. If an available tool can't be found, a `MissingDiffToolError` will be raised. This will contain a list of all tools tried, and any instructions that candidate tools may provide.
0fa88510199d1665b9da93b763520f5c92575728 Christian Hammond
docs/rbtools/api/coderef/index.rst
rbtools/diffs/tests/test_diff_tools_registry.py
rbtools/diffs/tools/errors.py
rbtools/diffs/tools/registry.py
rbtools/diffs/tools/base/diff_tool.py
Loading...