X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/335a6a59e66ee7c2cf0c68c659259b885f7e8a07..c83fd4a32868d46765a88f6903dd807f18c9ae84:/IkiWiki/Rcs/mercurial.pm?ds=sidebyside diff --git a/IkiWiki/Rcs/mercurial.pm b/IkiWiki/Rcs/mercurial.pm index 8c3f03e07..0cc1e291d 100644 --- a/IkiWiki/Rcs/mercurial.pm +++ b/IkiWiki/Rcs/mercurial.pm @@ -8,7 +8,51 @@ use IkiWiki; use Encode; use open qw{:utf8 :std}; -sub mercurial_log($) { +hook(type => "checkconfig", id => "mercurial", call => sub { #{{{ + if (! defined $config{diffurl}) { + $config{diffurl}=""; + } + if (exists $config{mercurial_wrapper}) { + push @{$config{wrappers}}, { + wrapper => $config{mercurial_wrapper}, + wrappermode => (defined $config{mercurial_wrappermode} ? $config{mercurial_wrappermode} : "06755"), + }; + } +}); #}}} + +hook(type => "getsetup", id => "mercurial", call => sub { #{{{ + return + mercurial_wrapper => { + type => "string", + #example => # FIXME add example + description => "mercurial post-commit executable to generate", + safe => 0, # file + rebuild => 0, + }, + mercurial_wrappermode => { + type => "string", + example => '06755', + description => "mode for mercurial_wrapper (can safely be made suid)", + safe => 0, + rebuild => 0, + }, + historyurl => { + type => "string", + example => "http://example.com:8000/log/tip/[[file]]", + description => "url to hg serve'd repository, to show file history ([[file]] substituted)", + safe => 1, + rebuild => 1, + }, + diffurl => { + type => "string", + example => "http://localhost:8000/?fd=[[r2]];file=[[file]]", + description => "url to hg serve'd repository, to show diff ([[file]] and [[r2]] substituted)", + safe => 1, + rebuild => 1, + }, +}); #}}} + +sub mercurial_log ($) { #{{{ my $out = shift; my @infos; @@ -52,7 +96,7 @@ sub mercurial_log($) { close $out; return @infos; -} +} #}}} sub rcs_update () { #{{{ my @cmdline = ("hg", "-q", "-R", "$config{srcdir}", "update");