diff options
author | Andreas K. Hüttel <dilfridge@gentoo.org> | 2016-01-17 16:34:14 +0100 |
---|---|---|
committer | Andreas K. Hüttel <dilfridge@gentoo.org> | 2016-01-17 16:34:39 +0100 |
commit | 438523a27ff5f43abb14bc5c784038e25333aae2 (patch) | |
tree | 81a092f7f398c3406e3df0965eb6e5b79594cfba /dev-vcs/git/files | |
parent | e0b3f694ceda2d7220431ee7b27011877bbd3230 (diff) | |
download | gentoo-438523a27ff5f43abb14bc5c784038e25333aae2.tar.gz gentoo-438523a27ff5f43abb14bc5c784038e25333aae2.tar.xz |
dev-vcs/git: Add yet another needed MediaWiki patch
Package-Manager: portage-2.2.26
Diffstat (limited to 'dev-vcs/git/files')
-rw-r--r-- | dev-vcs/git/files/git-2.7.0-mediawiki-500pages.patch | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/dev-vcs/git/files/git-2.7.0-mediawiki-500pages.patch b/dev-vcs/git/files/git-2.7.0-mediawiki-500pages.patch new file mode 100644 index 00000000000..0ce706db99a --- /dev/null +++ b/dev-vcs/git/files/git-2.7.0-mediawiki-500pages.patch @@ -0,0 +1,46 @@ +Searching for pages using the MediaWiki API returns at most 500 results +(hi Patrick). To get a list of all pages in a larger wiki, we need to run +repeated searches... + +Source: https://github.com/moy/Git-Mediawiki/issues/32 +Author: anarcat https://github.com/anarcat + +diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl +index 8dd74a9..f2ce311 100755 +--- a/contrib/mw-to-git/git-remote-mediawiki.perl ++++ b/contrib/mw-to-git/git-remote-mediawiki.perl +@@ -259,16 +259,29 @@ sub get_mw_tracked_categories { + sub get_mw_all_pages { + my $pages = shift; + # No user-provided list, get the list of pages from the API. +- my $mw_pages = $mediawiki->list({ ++ my $query = { + action => 'query', + list => 'allpages', + aplimit => 'max' +- }); +- if (!defined($mw_pages)) { ++ }; ++ my $curpage; ++ my $oldpage = ''; ++ while (1) { ++ if (defined($curpage)) { ++ if ($oldpage eq $curpage) { ++ last; ++ } ++ $query->{apfrom} = $curpage; ++ $oldpage = $curpage; ++ } ++ my $mw_pages = $mediawiki->list($query); ++ if (!defined($mw_pages)) { + fatal_mw_error("get the list of wiki pages"); +- } +- foreach my $page (@{$mw_pages}) { ++ } ++ foreach my $page (@{$mw_pages}) { + $pages->{$page->{title}} = $page; ++ $curpage = $page->{title}; ++ } + } + return; + } |