summaryrefslogtreecommitdiff
path: root/contrib/mw-to-git/Git
diff options
context:
space:
mode:
authorBenoit Person <benoit.person@ensimag.fr>2013-07-04 20:39:00 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-07-08 15:56:14 (GMT)
commit0078a7fa05b3d671739aefba5265da809ea32e55 (patch)
tree6655668814b361d1303787948c72f213b4482566 /contrib/mw-to-git/Git
parent07a263b9056ac7135ed84d64cabf80c5a6b1972e (diff)
downloadgit-0078a7fa05b3d671739aefba5265da809ea32e55.zip
git-0078a7fa05b3d671739aefba5265da809ea32e55.tar.gz
git-0078a7fa05b3d671739aefba5265da809ea32e55.tar.bz2
git-remote-mediawiki: add preview subcommand into git mw
In the current state, a user of git-remote-mediawiki can edit the markup text locally, but has to push to the remote wiki to see how the page is rendererd. Add a new 'git mw preview' command that allows rendering the markup text on the remote wiki without actually pushing any change on the wiki. This uses Mediawiki's API to render the markup and inserts it in an actual HTML page from the wiki so that CSS can be rendered properly. Most links should work when the page exists on the remote. Signed-off-by: Benoit Person <benoit.person@ensimag.fr> Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/mw-to-git/Git')
-rw-r--r--contrib/mw-to-git/Git/Mediawiki.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/contrib/mw-to-git/Git/Mediawiki.pm b/contrib/mw-to-git/Git/Mediawiki.pm
index 47fe4f4..d13c4df 100644
--- a/contrib/mw-to-git/Git/Mediawiki.pm
+++ b/contrib/mw-to-git/Git/Mediawiki.pm
@@ -19,7 +19,7 @@ require Exporter;
# Methods which can be called as standalone functions as well:
@EXPORT_OK = qw(clean_filename smudge_filename connect_maybe
- EMPTY HTTP_CODE_OK);
+ EMPTY HTTP_CODE_OK HTTP_CODE_PAGE_NOT_FOUND);
}
# Mediawiki filenames can contain forward slashes. This variable decides by which pattern they should be replaced
@@ -30,6 +30,7 @@ use constant EMPTY => q{};
# HTTP codes
use constant HTTP_CODE_OK => 200;
+use constant HTTP_CODE_PAGE_NOT_FOUND => 404;
sub clean_filename {
my $filename = shift;