summaryrefslogtreecommitdiff
path: root/contrib/mw-to-git/git-remote-mediawiki.perl
diff options
context:
space:
mode:
authorAntoine Beaupré <anarcat@debian.org>2017-11-07 16:06:57 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-11-08 02:06:33 (GMT)
commit09eebbadca58dbf8e415678eeef8de54c0be6534 (patch)
tree596cb50b4d0ed925ef7529139856712c2bf98732 /contrib/mw-to-git/git-remote-mediawiki.perl
parentcc92338004d6f3e613c9446ccdcddf11433be85f (diff)
downloadgit-09eebbadca58dbf8e415678eeef8de54c0be6534.zip
git-09eebbadca58dbf8e415678eeef8de54c0be6534.tar.gz
git-09eebbadca58dbf8e415678eeef8de54c0be6534.tar.bz2
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>
Diffstat (limited to 'contrib/mw-to-git/git-remote-mediawiki.perl')
-rwxr-xr-xcontrib/mw-to-git/git-remote-mediawiki.perl3
1 files changed, 2 insertions, 1 deletions
diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl
index a1d7837..5e88458 100755
--- a/contrib/mw-to-git/git-remote-mediawiki.perl
+++ b/contrib/mw-to-git/git-remote-mediawiki.perl
@@ -1334,7 +1334,8 @@ sub get_mw_namespace_id {
my $id;
if (!defined $ns) {
- print {*STDERR} "No such namespace ${name} on MediaWiki.\n";
+ my @namespaces = map { s/ /_/g; $_; } sort keys %namespace_id;
+ print {*STDERR} "No such namespace ${name} on MediaWiki, known namespaces: @namespaces\n";
$ns = {is_namespace => 0};
$namespace_id{$name} = $ns;
}