]> sipb.mit.edu Git - ikiwiki.git/blob - doc/bugs/Http_error_500_when_using_mercurial_backend.mdwn
web commit by hb
[ikiwiki.git] / doc / bugs / Http_error_500_when_using_mercurial_backend.mdwn
1 The mercurial backend is broken when no changelog message is given.
2
3 Here is a quick patch, partialy copying the svn backend. 
4
5     --- /usr/share/perl5/IkiWiki/Rcs/mercurial.pm       2007-03-18 23:19:40.000000000 +0100
6     +++ ./mercurial.pm  2007-03-24 13:11:36.000000000 +0100
7     @@ -70,12 +70,15 @@
8      
9         if (defined $user) {
10                 $user = possibly_foolish_untaint($user);
11     +           $message="web commit by $user".(length $message ? ": $message" : "");
12         }
13         elsif (defined $ipaddr) {
14                 $user = "Anonymous from $ipaddr";
15     +           $message="web commit from $ipaddr".(length $message ? ": $message" : "");
16         }
17         else {
18                 $user = "Anonymous";
19     +           $message="web commit by Anonymous".(length $message ? ": $message" : "");
20         }
21      
22         $message = possibly_foolish_untaint($message);
23
24 > The svn backend puts the user info in the message because that's the only
25 > way to store the user info, unlike with mercurial. The svn plugin also
26 > removes that info when getting the RecentChanges info. Since mercurial
27 > does not do that, it seemed better to me to test for an empty message and
28 > set it to a dummy commit string, which I've [[done]]. --[[Joey]]
29 >>Thanks for the correct fix, Joey.