* Fix mercurial backend to deal with empty commit messages.

master
joey 2007-03-24 15:14:53 +00:00
parent bbb0b3e72f
commit c936ba1719
3 changed files with 14 additions and 4 deletions

View File

@ -79,9 +79,12 @@ sub rcs_commit ($$$;$$) { #{{{
}
$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: $!";
}

3
debian/changelog vendored
View File

@ -15,8 +15,9 @@ ikiwiki (1.48) UNRELEASED; urgency=low
* Renamed %oldpagemtime to a more accurately named %pagemtime and fix it to
actually store pages' mtimes.
* Add "mtime" sort parameter to inline plugin.
* Fix mercurial backend to deal with empty commit messages.
-- Joey Hess <joeyh@debian.org> Fri, 23 Mar 2007 16:16:39 -0400
-- Joey Hess <joeyh@debian.org> Sat, 24 Mar 2007 11:14:10 -0400
ikiwiki (1.47) unstable; urgency=low

View File

@ -19,4 +19,10 @@ Here is a quick patch, partialy copying the svn backend.
+ $message="web commit by Anonymous".(length $message ? ": $message" : "");
}
$message = possibly_foolish_untaint($message);
$message = possibly_foolish_untaint($message);
> The svn backend puts the user info in the message because that's the only
> way to store the user info, unlike with mercurial. The svn plugin also
> removes that info when getting the RecentChanges info. Since mercurial
> does not do that, it seemed better to me to test for an empty message and
> set it to a dummy commit string, which I've [[done]]. --[[Joey]]