git-remote-mediawiki: change return type of get_mw_pages

The previous version was returning the list of pages to be fetched, but we are going to need an efficient membership test (i.e. is the page $title tracked), hence exposing a hash will be more convenient. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Matthieu Moy committed Jul 6, 2012 at 12:03 UTC b1ede9a9f232b1416d1487bba3f69a8e88ec75ee
1 file changed +5 -3
contrib/mw-to-git/git-remote-mediawiki
+5 -3
@@ -379,7 +379,7 @@ sub get_mw_pages {
379 get_all_mediafiles(\%pages);
380 }
381 }
382 - return values(%pages);
382 + return %pages;
383 }
384
385 # usage: $out = run_git("command args");
@@ -536,7 +536,8 @@ my %basetimestamps;
536 sub get_last_remote_revision {
537 mw_connect_maybe();
538
539 - my @pages = get_mw_pages();
539 + my %pages_hash = get_mw_pages();
540 + my @pages = values(%pages_hash);
541
542 my $max_rev_num = 0;
543
@@ -802,7 +803,8 @@ sub mw_import_ref {
803
804 mw_connect_maybe();
805
805 - my @pages = get_mw_pages();
806 + my %pages_hash = get_mw_pages();
807 + my @pages = values(%pages_hash);
808
809 print STDERR "Searching revisions...\n";
810 my $last_local = get_last_local_revision();