File tree Expand file tree Collapse file tree 2 files changed +35
-2
lines changed Expand file tree Collapse file tree 2 files changed +35
-2
lines changed Original file line number Diff line number Diff line change @@ -625,6 +625,9 @@ sub fetch_mw_revisions_for_page {
625
625
rvstartid => $fetch_from ,
626
626
rvlimit => 500,
627
627
pageids => $id ,
628
+
629
+ # Let MediaWiki know that we support the latest API.
630
+ continue => ' ' ,
628
631
};
629
632
630
633
my $revnum = 0;
@@ -640,8 +643,15 @@ sub fetch_mw_revisions_for_page {
640
643
push (@page_revs , $page_rev_ids );
641
644
$revnum ++;
642
645
}
643
- last if (!$result -> {' query-continue' });
644
- $query -> {rvstartid } = $result -> {' query-continue' }-> {revisions }-> {rvstartid };
646
+
647
+ if ($result -> {' query-continue' }) { # For legacy APIs
648
+ $query -> {rvstartid } = $result -> {' query-continue' }-> {revisions }-> {rvstartid };
649
+ } elsif ($result -> {continue }) { # For newer APIs
650
+ $query -> {rvstartid } = $result -> {continue }-> {rvcontinue };
651
+ $query -> {continue } = $result -> {continue }-> {continue };
652
+ } else {
653
+ last ;
654
+ }
645
655
}
646
656
if ($shallow_import && @page_revs ) {
647
657
print {*STDERR } " Found 1 revision (shallow import).\n " ;
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ test_description=' Test the Git Mediawiki remote helper: queries w/ more than 500 results'
4
+
5
+ . ./test-gitmw-lib.sh
6
+ . $TEST_DIRECTORY /test-lib.sh
7
+
8
+ test_check_precond
9
+
10
+ test_expect_success ' creating page w/ >500 revisions' '
11
+ wiki_reset &&
12
+ for i in `test_seq 501`
13
+ do
14
+ echo "creating revision $i" &&
15
+ wiki_editpage foo "revision $i<br/>" true
16
+ done
17
+ '
18
+
19
+ test_expect_success ' cloning page w/ >500 revisions' '
20
+ git clone mediawiki::' " $WIKI_URL " ' mw_dir
21
+ '
22
+
23
+ test_done
You can’t perform that action at this time.
0 commit comments