Add a flag on commands to indicate that diffing is required.

Review Request #12605 — Created Sept. 15, 2022 and submitted

Information

RBTools
release-4.x

Reviewers

This introduces Command.needs_diffs. If set to True, SCMClient
instantiation will check if any required diff tools are available. This
will allow the command to fail early with useful instructions.

This is set on rbt diff and rbt post.

Note that this does mean that rbt post can't be used if the matching
client doesn't have an available diff tool. While it's technically
possible to use rbt post without generating diffs, this isn't the
common case, and an available diff tool is a pretty reasonable
expectation to set.

Unit tests pass.

Tested rbt diff and rbt post with and without a working diff tool
for a client that requires it (Perforce, in my case), when used with an
upcoming change that adds these requirements to each client.

Summary ID
Add a flag on commands to indicate that diffing is required.
This introduces `Command.needs_diffs`. If set to `True`, SCMClient instantiation will check if any required diff tools are available. This will allow the command to fail early with useful instructions. This is set on `rbt diff` and `rbt post`. Note that this does mean that `rbt post` can't be used if the matching client doesn't have an available diff tool. While it's technically possible to use `rbt post` without generating diffs, this isn't the common case, and an available diff tool is a pretty reasonable expectation to set.
ee83ba45d2adaa1192522b1fba921d812e902ff0
maubin
  1. Ship It!
  2. 
      
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-4.x (b13627d)