]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Rcs/mercurial.pm
wrapper setup reorg
[git.ikiwiki.info.git] / IkiWiki / Rcs / mercurial.pm
index 2ccba04da3e48540eba3138e99d4b038503e45aa..0cc1e291dfa46ea6e145feaf7ac229fc895f8684 100644 (file)
@@ -8,11 +8,36 @@ use IkiWiki;
 use Encode;
 use open qw{:utf8 :std};
 
+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",
-                       default => "",
                        example => "http://example.com:8000/log/tip/[[file]]",
                        description => "url to hg serve'd repository, to show file history ([[file]] substituted)",
                        safe => 1,
@@ -20,7 +45,6 @@ hook(type => "getsetup", id => "mercurial", call => sub { #{{{
                },
                diffurl => {
                        type => "string",
-                       default => "",
                        example => "http://localhost:8000/?fd=[[r2]];file=[[file]]",
                        description => "url to hg serve'd repository, to show diff ([[file]] and [[r2]] substituted)",
                        safe => 1,
@@ -28,7 +52,7 @@ hook(type => "getsetup", id => "mercurial", call => sub { #{{{
                },
 }); #}}}
 
-sub mercurial_log($) {
+sub mercurial_log ($) { #{{{
        my $out = shift;
        my @infos;
 
@@ -72,7 +96,7 @@ sub mercurial_log($) {
        close $out;
 
        return @infos;
-}
+} #}}}
 
 sub rcs_update () { #{{{
        my @cmdline = ("hg", "-q", "-R", "$config{srcdir}", "update");