X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/958468b0883783cebd57086e80ec58f578c82074..99292550fdf3c5bf9feb4a665e2de99f5cfc0d35:/IkiWiki/Wrapper.pm?ds=sidebyside diff --git a/IkiWiki/Wrapper.pm b/IkiWiki/Wrapper.pm index 2e4925a1f..d72368446 100644 --- a/IkiWiki/Wrapper.pm +++ b/IkiWiki/Wrapper.pm @@ -35,6 +35,16 @@ sub gen_wrapper () { #{{{ asprintf(&newenviron[i++], "%s=%s", "$var", s); EOF } + if ($config{svn} && $config{notify}) { + # Support running directly as hooks/post-commit by passing + # $2 in REV in the environment. + $envsave.=<<"EOF" + if (argc == 3) + asprintf(&newenviron[i++], "REV=%s", argv[2]); + else if ((s=getenv("REV"))) + asprintf(&newenviron[i++], "%s=%s", "REV", s); +EOF + } $Data::Dumper::Indent=0; # no newlines my $configstring=Data::Dumper->Dump([\%config], ['*config']); @@ -55,7 +65,7 @@ extern char **environ; int main (int argc, char **argv) { /* Sanitize environment. */ char *s; - char *newenviron[$#envsave+4]; + char *newenviron[$#envsave+5]; int i=0; $envsave newenviron[i++]="HOME=$ENV{HOME}";