Major rewrite of libbe.diff introduces DiffTree and Diff classes.
authorW. Trevor King <wking@drexel.edu>
Mon, 27 Jul 2009 09:14:49 +0000 (05:14 -0400)
committerW. Trevor King <wking@drexel.edu>
Mon, 27 Jul 2009 09:14:49 +0000 (05:14 -0400)
commite21a427afbc7369cfa3a3f786e51aaa1e3e01999
tree8a7ba397e499b20ca0ebdd2535e2d8c6b6fc86c7
parent58e2b9fe7a13e7cd99e085059867453496712593
Major rewrite of libbe.diff introduces DiffTree and Diff classes.

To make the interface proposed by becommands/subscribers.py easier to
implement, I've moved the libbe.diff functionality into classes.  Now
it should be easy two tweak the output as desired by subclassing these
classes.  The basic idea is that Diff.report_tree() generates a
diff_tree tree of changes between two bugdirs, where diff_tree is some
subclass of DiffTree.  Each type of change has a default .*_string()
method producing a string summary of the change.  DiffTree.report()
moves through and generates a report by joining all those summary
strings to a single root, and DiffTree.report_string() serialized the
report to produce e.g. the output of becommands/diff.py.
becommands/diff.py
libbe/diff.py