Skip to content

Commit 09eebba

Browse files
anarcatgitster
authored andcommitted
remote-mediawiki: show known namespace choices on failure
If we fail to find a requested namespace, we should tell the user which ones we know about, since those were already fetched. This allows users to fetch all namespaces by specifying a dummy namespace, failing, then copying the list of namespaces in the config. Eventually, we should have a flag that allows fetching all namespaces automatically. Reviewed-by: Antoine Beaupré <anarcat@debian.org> Signed-off-by: Antoine Beaupré <anarcat@debian.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent cc92338 commit 09eebba

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

contrib/mw-to-git/git-remote-mediawiki.perl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1334,7 +1334,8 @@ sub get_mw_namespace_id {
13341334
my $id;
13351335

13361336
if (!defined $ns) {
1337-
print {*STDERR} "No such namespace ${name} on MediaWiki.\n";
1337+
my @namespaces = map { s/ /_/g; $_; } sort keys %namespace_id;
1338+
print {*STDERR} "No such namespace ${name} on MediaWiki, known namespaces: @namespaces\n";
13381339
$ns = {is_namespace => 0};
13391340
$namespace_id{$name} = $ns;
13401341
}

0 commit comments

Comments
 (0)