libgit2/pygit2 — pull request #346 by petrhosek (2014-02-15 20:56:20+00:00)
Title: Diff and Patch interface refactored

This is a complete refactoring of the diff and patch interface. The changes include:

* Splitting `Diff` and `Patch` into separate classes and files, including respective tests. This largely follwos the recent development in `libgit2`.
* Introducing `DiffDelta`, `DiffFile` and `DiffLine` classes and their respective iterators.
* Moving the recently introduced `Blob` diff methods into patch again to be in line with the respective `libgit2` interface.

The biggest difference, apart from the code cleanup, is the lazy evaluation due to heavy use of iterators rather than evaluating everything ahead of time as in case of the existing code, which tends to be slow on larger projects.

I have tried to make the interface as "Pythonic" as possible, while closely following the underlying `libgit2` C interface. However, some of you might think of a better abstraction and I'd happy to incorporate further changes into the patch.