ClearCase updates part 2: typing and consolidation.
Review Request #13606 — Created March 4, 2024 and submitted — Latest diff uploaded
This change is a somewhat more invasive refactor of the ClearCase
backend in RBTools.To start with, we had several different definitions of what a
"changeset" was throughout the code. Some places used it to mean a list
of 2-tuples containing extended path pairs. Some places used it to mean
a list of 3-tuples containing a path and two versions. And finally, our
diff implementation used it to mean a list ofChangesetEntry
objects.I've reworked this to define a "changelist" as the list of extended path
pairs (aliased as_ChangedEntry
), which is what gets returned by all
of the different methods for the various types of revision specs. This
then gets processed and turned into a "changeset" which is the list of
_ChangesetEntry
objects. A couple of the revision types use one
additional type,_BranchedChangedEntry
, which is the 3-tuple form.We also had a number of methods that were unnecessarily implemented as
their own functions. These have for the most part been folded back into
the one place they got called from.Most of the code that deals with changelists has been updated to yield
items rather than build new lists. In some cases we were rebuilding
lists up to 7 times.This change also adds type hints to the rest of the implementation.
Ran unit tests.