Thread (13 messages) flat view 13 messages, 1 author, 2016-06-15
DORMANTno replies

Revision v1 of 2 in this series.

Revisions (2)
  1. v1 current
  2. v1 [diff vs current]

[PATCH 08/12] git-remote-mediawiki: change return type of get_mw_pages

From: Matthieu Moy <hidden>
Date: 2016-06-15 22:54:13
Subsystem: the rest · Maintainer: Linus Torvalds

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 <redacted>
---
 contrib/mw-to-git/git-remote-mediawiki | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/contrib/mw-to-git/git-remote-mediawiki b/contrib/mw-to-git/git-remote-mediawiki
index 76b78bc..3f57598 100755
--- a/contrib/mw-to-git/git-remote-mediawiki
+++ b/contrib/mw-to-git/git-remote-mediawiki
@@ -377,7 +377,7 @@ sub get_mw_pages {
 			get_all_mediafiles(\%pages);
 		}
 	}
-	return values(%pages);
+	return %pages;
 }
 
 # usage: $out = run_git("command args");
@@ -563,7 +563,8 @@ my %basetimestamps;
 sub get_last_remote_revision {
 	mw_connect_maybe();
 
-	my @pages = get_mw_pages();
+	my %pages_hash = get_mw_pages();
+	my @pages = values(%pages_hash);
 
 	my $max_rev_num = 0;
 
@@ -829,7 +830,8 @@ sub mw_import_ref {
 
 	mw_connect_maybe();
 
-	my @pages = get_mw_pages();
+	my %pages_hash = get_mw_pages();
+	my @pages = values(%pages_hash);
 
 	print STDERR "Searching revisions...\n";
 	my $last_local = get_last_local_revision();
-- 
1.7.11.1.147.g47a574d
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help