added basic diff example and fixed misleading doc

This commit is contained in:
Nico von Geyso 2013-04-19 15:08:48 +02:00
parent 611e979113
commit 067b00de4f
2 changed files with 7 additions and 1 deletions

View File

@ -17,6 +17,12 @@ A diff shows the changes between trees, an index or the working dir::
# Diff a tree with the current working dir
>>> diff = head.tree.diff()
# Get all patches for a diff
>>> t0 = repo.revparse_single('HEAD^').tree
>>> t1 = repo.revparse_single('HEAD~3').tree
>>> diff = t0.diff(t1)
>>> patches = [p for p in diff]
The Diff type
====================

View File

@ -227,7 +227,7 @@ PyTypeObject DiffIterType = {
};
PyDoc_STRVAR(Diff_patch__doc__, "Patch.");
PyDoc_STRVAR(Diff_patch__doc__, "Patch diff string.");
PyObject *
Diff_patch__get__(Diff *self)