This script (obviously) follows a lot of code from commit-email.pl and svnlook, and started on that path for printing diffs. But when it came to figuring out the base rev/root for performing diffs, the svnlook pattern would compute that during tree-navigation during the printing. I discovered it was much easier to just do this while collecting the changes themselves.
This script (obviously) follows a lot of code from commit-email.pl and
svnlook, and started on that path for printing diffs. But when it came
to figuring out the base rev/root for performing diffs, the svnlook
pattern would compute that during tree-navigation during the printing.
I discovered it was much easier to just do this while collecting the
changes themselves.

This change revamps the ChangeCollector [editor] class to remember the
base path and revision for each item that was changed. At rendering
time, we can easily perform the appropriate diff without needing to
have extensive code to generate that base. This is especially
necessary since our data structures are not built in a parent/child
relationship such as those from the "node_editor" of svn_repos (since
that kind of structure can more easily track the imposition of a new
base on child nodes).

The actual output generation is little changed, as this is mostly
about collecting the data in the first place.

* hook-scripts/mailer.py:
  (class _change): records a specific change to a resource in the
    repository
  (generate_content): the dicts map to change objects; tweak the data
    flow to the lower funcs
  (generate_diff): take a change object rather than a tuple
  (class Repository): set up a dict of roots so that (in the future)
    we can cache open roots based on a group of revs
  (class ChangeCollector): revamp the batons to pass (path, base_path,
    base_rev). store _change instances rather than lists.
  (_svn_basename): new helper function to compute a basename
  (True, False): set these up if they don't already exist

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