Move chunk generation out of diffutils and into DiffChunkGenerator.

Review Request #4163 — Created May 25, 2013 and submitted — Latest diff uploaded

Information

Review Board
release-1.7.x

Reviewers

Move chunk generation out of diffutils and into DiffChunkGenerator.

This class handles all the responsibilities of diff chunk generation.
It's basically the same code as before, but some things were able to be
cleaned up. For example, all the nested functions are gone, and instead
are just methods of the class. Functions can access self.<whatever>
instead of variables that happen to be in scope or variables. The yields
don't have to pass chunk_index and then increment it themselves.

This drastically shortens what's in diffutils.py. It also reduces how
much populate_diff_chunks now has to do.
Tested against several diffs in my tree. No problems.

Unit tests pass.