Revamp how the text is generated for email. Rather than writing to the output from many functions, then new code assembles a big hunk of data and gives that to an object to render it appropriately. To avoid loading a bunch of diffs and/or diff content in memory, we use a generator to cough up diffs to run and the diff content as the rendering process occurs.
Revamp how the text is generated for email. Rather than writing to the
output from many functions, then new code assembles a big hunk of data and
gives that to an object to render it appropriately. To avoid loading a
bunch of diffs and/or diff content in memory, we use a generator to cough
up diffs to run and the diff content as the rendering process occurs.

At this point, regular commit email uses the new rendering model. Revprop
changes are still old school. That stuff will come next, along with an
option to render using EZT templates (tho the script will not require the
additional dependency).

* tools/hook-scripts/mailer/mailer.py:
  (Commit.generate): construct a TextCommitRenderer and pass that to the
    generate_content() function.
  (generate_content): take a renderer object. put all of the various data
    into a new _data instance. calls to generate_list() return a list, so
    do something with it. stop iterating over the changelist looking for
    stuff -- leave that to the DiffGenerator.
  (generate_list): don't take an output object and stop generating output.
    instead, build a list of _data instances which contain all the
    necessary data to write out a list of adds/deletes/modifies.
  (generate_diff): removed. much of the logic effectively moved into the
    DiffGenerator class.
  (class DiffGenerator): new class that can be used in a for-loop. it acts
    as a sequence, where each item is a _data instance holding the various
    details of a diff operation.
  (class DiffContent): new class that can be used in a for-loop. it acts
    as a sequence, returning annotated lines of a unified diff output.
  (class TextCommitRenderer): new class to render a text/plain commit mail
    using an object holding all the necessary data.
  (class _data): simply little class to hold attribute-based data.

jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion