From 785b5112abfb67294e6fd4ee47a081ba157478f0 Mon Sep 17 00:00:00 2001 From: Andrey Devyatkin <andrey.a.devyatkin@gmail.com> Date: Fri, 17 May 2013 22:20:44 +0200 Subject: [PATCH] Add example for repo.walk pydoc --- src/repository.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/repository.c b/src/repository.c index af388f4..9409bad 100644 --- a/src/repository.c +++ b/src/repository.c @@ -540,7 +540,14 @@ Repository_merge_base(Repository *self, PyObject *args) PyDoc_STRVAR(Repository_walk__doc__, "walk(oid, sort_mode) -> iterator\n" "\n" - "Generator that traverses the history starting from the given commit."); + "Generator that traverses the history starting from the given commit.\n" + "\n" + "Example:\n" + "\n" + "import pygit2" + "repo = pygit2.Repository(.git)\n" + "for object in repo.walk(repo.head.oid, pygit2.GIT_SORT_TOPOLOGICAL):\n" + " print object.message"); PyObject * Repository_walk(Repository *self, PyObject *args)