Add a DOM function for generating the "stats" metadata.

Review Request #11743 — Created July 23, 2021 and submitted — Latest diff uploaded

Information

DiffX
master

Reviewers

This introduces DiffX.generate_stats(),
DiffXChangeSection.generate_stats(), and
DiffXFileSection.generate_stats(). These are used to generate metadata
containing useful statistics on the diff, such as the number of files,
changes, inserts/deletes, and changed lines in a diff.

Callers can call this immediately prior to writing the DiffX to a
stream, in order to provide this information for consumers of the diff.

Unit tests pass on Python 2 and 3.

Diff Revision 1 (Latest)

Commits

First Last Summary ID Author
Add a DOM function for generating the "stats" metadata.
This introduces `DiffX.generate_stats()`, `DiffXChangeSection.generate_stats()`, and `DiffXFileSection.generate_stats()`. These are used to generate metadata containing useful statistics on the diff, such as the number of files, changes, inserts/deletes, and changed lines in a diff. Callers can call this immediately prior to writing the DiffX to a stream, in order to provide this information for consumers of the diff.
86e195955c291f23cbe7f1af09ceb6d79099541e Christian Hammond
python/dev-requirements.txt
python/pydiffx/errors.py
python/pydiffx/dom/objects.py
python/pydiffx/tests/test_dom_objects.py
Loading...