X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/cb0c642aed71ec8af797e8c59c61f6ea882cf541..6717ea5b953f17b8667845fedea87273a7d99371:/IkiWiki/Rcs/mercurial.pm diff --git a/IkiWiki/Rcs/mercurial.pm b/IkiWiki/Rcs/mercurial.pm index e4cc6deb3..db6a396ac 100644 --- a/IkiWiki/Rcs/mercurial.pm +++ b/IkiWiki/Rcs/mercurial.pm @@ -72,16 +72,19 @@ sub rcs_commit ($$$;$$) { #{{{ $user = possibly_foolish_untaint($user); } elsif (defined $ipaddr) { - $user = "Anonymous from $ipaddr"; + $user = "Anonymous from ".possibly_foolish_untaint($ipaddr); } else { $user = "Anonymous"; } $message = possibly_foolish_untaint($message); + if (! length $message) { + $message = "no message given"; + } - my @cmdline = ("hg", "-q", "-R", "$config{srcdir}", "commit", - "-m", "$message", "-u", "$user"); + my @cmdline = ("hg", "-q", "-R", $config{srcdir}, "commit", + "-m", $message, "-u", $user); if (system(@cmdline) != 0) { warn "'@cmdline' failed: $!"; } @@ -92,7 +95,7 @@ sub rcs_commit ($$$;$$) { #{{{ sub rcs_add ($) { # {{{ my ($file) = @_; - my @cmdline = ("hg", "-q", "-R", "$config{srcdir}", "add", "$file"); + my @cmdline = ("hg", "-q", "-R", "$config{srcdir}", "add", "$config{srcdir}/$file"); if (system(@cmdline) != 0) { warn "'@cmdline' failed: $!"; } @@ -104,7 +107,8 @@ sub rcs_recentchanges ($) { #{{{ eval q{use CGI 'escapeHTML'}; error($@) if $@; - my @cmdline = ("hg", "-R", $config{srcdir}, "log", "-v", "-l", $num); + my @cmdline = ("hg", "-R", $config{srcdir}, "log", "-v", "-l", $num, + "--style", "default"); open (my $out, "@cmdline |"); eval q{use Date::Parse}; @@ -138,7 +142,7 @@ sub rcs_recentchanges ($) { #{{{ rev => $info->{"changeset"}, user => $user, committype => "mercurial", - when => time - str2time($info->{"date"}), + when => str2time($info->{"date"}), message => [@message], pages => [@pages], }; @@ -147,16 +151,13 @@ sub rcs_recentchanges ($) { #{{{ return @ret; } #}}} -sub rcs_notify () { #{{{ - # TODO -} #}}} - sub rcs_getctime ($) { #{{{ my ($file) = @_; # XXX filename passes through the shell here, should try to avoid # that just in case - my @cmdline = ("hg", "-R", $config{srcdir}, "log", "-v", "-l", '1', $file); + my @cmdline = ("hg", "-R", $config{srcdir}, "log", "-v", "-l", '1', + "--style", "default", "$config{srcdir}/$file"); open (my $out, "@cmdline |"); my @log = mercurial_log($out);