rbtools.commands.post had two classes for managing diff results:
SquashedDiff represents a single diff result for any range of commits,
without any commit history information.
DiffHistory represents commits across multiple commits, with a
cumulative diff spanning all changes.
These have been internal to the
rbt post command, defined as
namedtuples (despite not used tuple functionality for these). With
some work planned for cleaning up the posting logic, it was time to
clean up these classes and move them out of this command.
Both of these now live in
rbtools.clients.base.diffs. They contain
standard utility methods for building an instance from a diff result
from a SCMClient, and inherit from a base class that holds common
One API change here is that
DiffHistory.cumulative_diff has been
DiffHistory.diff. This was done to simplify code that may
take either object and needs to extract the diff, and to let us leverage
as many common fields as possible.
These are still just used in
rbt post, but RBTools 5 will begin to
make use of these in other modules.