remote-mediawiki: support fetching from (Main) namespace
commitda2a180977166aedafb34ed7eb68edf9e488b377
authorAntoine Beaupré <anarcat@debian.org>
Tue, 7 Nov 2017 16:06:59 +0000 (7 11:06 -0500)
committerJunio C Hamano <gitster@pobox.com>
Wed, 8 Nov 2017 02:06:33 +0000 (8 11:06 +0900)
tree20eb791ec9e0e770286e7d22fb01acaf9e278b93
parentdb3364352da98f20915e1b838616688f388fad8b
remote-mediawiki: support fetching from (Main) namespace

When we specify a list of namespaces to fetch from, by default the MW
API will not fetch from the default namespace, refered to as "(Main)"
in the documentation:

https://www.mediawiki.org/wiki/Manual:Namespace#Built-in_namespaces

I haven't found a way to address that "(Main)" namespace when getting
the namespace ids: indeed, when listing namespaces, there is no
"canonical" field for the main namespace, although there is a "*"
field that is set to "" (empty). So in theory, we could specify the
empty namespace to get the main namespace, but that would make
specifying namespaces harder for the user: we would need to teach
users about the "empty" default namespace. It would also make the code
more complicated: we'd need to parse quotes in the configuration.

So we simply override the query here and allow the user to specify
"(Main)" since that is the publicly documented name.

Signed-off-by: Antoine Beaupré <anarcat@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/mw-to-git/git-remote-mediawiki.perl