Add a new Tool.build_base_command() for centralizing command building.
Review Request #11548 — Created March 22, 2021 and submitted — Latest diff uploaded
Several tools need to build a command that refers to a temporary
configuration file, to control tool behavior. To avoid a lot of repeated
work and the creation of many temporary files, some tools create part of
the command (and related files) up-front inhandle_files()
or
execute()
. Others don't bother, and this can matter for larger
changes, slowing down execution or flooding the filesystem with
temporary files.To standardize behavior, this change introduces a new
Tool.build_base_command()
method. This will be called inexecute()
,
and the result will be passed on tohandle_files()
and
handle_file()
, which can then build onto it to construct and execute
the command.This is disabled for legacy tools.
Unit tests pass on Python 2.7 and 3.x.