summaryrefslogtreecommitdiff
path: root/contrib/mw-to-git/t
diff options
context:
space:
mode:
authorBenoit Person <benoit.person@gmail.com>2013-09-24 19:32:30 (GMT)
committerJonathan Nieder <jrnieder@gmail.com>2013-09-24 19:42:21 (GMT)
commit1d905f74fd2b05dcbc768acbb5426dc11fb00f6f (patch)
treed3ed6370c0c4349452ad9805522143c8ca5ae6fc /contrib/mw-to-git/t
parenta0d3f1090d90c895b785a6729ed2a2af25335a39 (diff)
downloadgit-1d905f74fd2b05dcbc768acbb5426dc11fb00f6f.zip
git-1d905f74fd2b05dcbc768acbb5426dc11fb00f6f.tar.gz
git-1d905f74fd2b05dcbc768acbb5426dc11fb00f6f.tar.bz2
git-remote-mediawiki: bugfix for pages w/ >500 revisions
Mediawiki introduces a new API for queries w/ more than 500 results in version 1.21. That change triggered an infinite loop while cloning a mediawiki with such a page. The latest API renamed and moved the "continuing" information in the response, necessary to build the next query. The code failed to retrieve that information but still detected that it was in a "continuing query". As a result, it launched the same query over and over again. If a "continuing" information is detected in the response (old or new), the next query is updated accordingly. If not, we quit assuming it's not a continuing query. Reported-by: Benjamin Cathey Signed-off-by: Benoit Person <benoit.person@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Diffstat (limited to 'contrib/mw-to-git/t')
-rwxr-xr-xcontrib/mw-to-git/t/t9365-continuing-queries.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/contrib/mw-to-git/t/t9365-continuing-queries.sh b/contrib/mw-to-git/t/t9365-continuing-queries.sh
new file mode 100755
index 0000000..27e267f
--- /dev/null
+++ b/contrib/mw-to-git/t/t9365-continuing-queries.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+test_description='Test the Git Mediawiki remote helper: queries w/ more than 500 results'
+
+. ./test-gitmw-lib.sh
+. $TEST_DIRECTORY/test-lib.sh
+
+test_check_precond
+
+test_expect_success 'creating page w/ >500 revisions' '
+ wiki_reset &&
+ for i in `test_seq 501`
+ do
+ echo "creating revision $i" &&
+ wiki_editpage foo "revision $i<br/>" true
+ done
+'
+
+test_expect_success 'cloning page w/ >500 revisions' '
+ git clone mediawiki::'"$WIKI_URL"' mw_dir
+'
+
+test_done