Consolidate keyword argument building for diff() calls.

Review Request #12238 — Created April 18, 2022 and submitted — Latest diff uploaded

Information

RBTools
release-3.x

Reviewers

rbt post has a lot of duplication of logic when it comes to building
diffs. There are two functions responsible for diff building:
_get_diff_history() and _get_squashed_diff(). Both build the same
dictionary of common keyword arguments up-front. _get_diff_history()
then proceeds to make multiple diff() calls and passes in (and
re-computes) values for each call, rather than putting those into the
common dictionary.

This change introduces _build_get_diff_kwargs(), which computes all
actual common arguments. These functions then call them and pass the
results into each diff() call. This simplifies their code
considerably, and should help avoid issues in the future.

Tested posting squashed and history diffs for review locally. Posted
this change as well.

rbt post unit tests pass.

Commits

Files