Merge remote-tracking branch 'upstream/master' into features/diff_refactoring

This commit is contained in:
Nico von Geyso 2013-05-20 14:59:37 +02:00
commit 1af00ee1bd
2 changed files with 23 additions and 7 deletions

View File

@ -3,9 +3,3 @@ Commit log
**********************************************************************
.. automethod:: pygit2.Repository.walk
You can iterate through the revision history with repo.walk::
>>> from pygit2 import GIT_SORT_TIME
>>> for commit in repo.walk(oid, GIT_SORT_TIME):
... print(commit.hex)

View File

@ -540,7 +540,29 @@ 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"
"The following types of sorting could be used to control traversing\n"
"direction:\n"
"\n"
"* GIT_SORT_NONE. This is the default sorting for new walkers\n"
" Sort the repository contents in no particular ordering\n"
"* GIT_SORT_TOPOLOGICAL. Sort the repository contents in topological order\n"
" (parents before children); this sorting mode can be combined with\n"
" time sorting.\n"
"* GIT_SORT_TIME. Sort the repository contents by commit time\n"
"* GIT_SORT_REVERSE. Iterate through the repository contents in reverse\n"
" order; this sorting mode can be combined with any of the above.\n"
"\n"
"Example:\n"
"\n"
" >>> from pygit2 import Repository\n"
" >>> from pygit2 import GIT_SORT_TOPOLOGICAL, GIT_SORT_REVERSE\n"
" >>> repo = Repository('.git')\n"
" >>> for commit in repo.walk(repo.head.oid, GIT_SORT_TOPOLOGICAL):\n"
" ... print commit.message\n"
" >>> for commit in repo.walk(repo.head.oid, GIT_SORT_TOPOLOGICAL | GIT_SORT_REVERSE):\n"
" ... print commit.message\n"
" >>>\n");
PyObject *
Repository_walk(Repository *self, PyObject *args)