]> sipb.mit.edu Git - ikiwiki.git/commitdiff
updates
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Wed, 22 Nov 2006 14:28:38 +0000 (14:28 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Wed, 22 Nov 2006 14:28:38 +0000 (14:28 +0000)
IkiWiki/CGI.pm
IkiWiki/Plugin/goodstuff.pm [moved from IkiWiki/Plugin/goodstuff.mdwn with 100% similarity]
IkiWiki/Plugin/toggle.pm
IkiWiki/Rcs/Stub.pm
IkiWiki/Rcs/git.pm
IkiWiki/Rcs/mercurial.pm
IkiWiki/Rcs/svn.pm
IkiWiki/Rcs/tla.pm
debian/changelog
doc/index.mdwn

index b90b43d8dc37a825ec680ca0a763330d66ca52d1..1caea99a4e6d930705154830c2271c9fcebf11ee 100644 (file)
@@ -478,20 +478,13 @@ sub cgi_editpage ($$) { #{{{
                $content=~s/\r/\n/g;
                writefile($file, $config{srcdir}, $content);
                
-               my $message="web commit ";
-               if (defined $session->param("name") && 
-                   length $session->param("name")) {
-                       $message.="by ".$session->param("name");
-               }
-               else {
-                       $message.="from $ENV{REMOTE_ADDR}";
-               }
-               if (defined $form->field('comments') &&
-                   length $form->field('comments')) {
-                       $message.=": ".$form->field('comments');
-               }
-               
                if ($config{rcs}) {
+                       my $message="";
+                       if (defined $form->field('comments') &&
+                           length $form->field('comments')) {
+                               $message=$form->field('comments');
+                       }
+                       
                        if ($newfile) {
                                rcs_add($file);
                        }
@@ -500,7 +493,8 @@ sub cgi_editpage ($$) { #{{{
                        # presumably the commit will trigger an update
                        # of the wiki
                        my $conflict=rcs_commit($file, $message,
-                               $form->field("rcsinfo"));
+                               $form->field("rcsinfo"),
+                               $session->param("name"), $ENV{REMOTE_ADDR});
                
                        if (defined $conflict) {
                                $form->field(name => "rcsinfo", value => rcs_prepedit($file),
index 92a89bd79fe70fa18715bf8451ddc9d831410d57..9e1afc08dbfa737ac5f29f079a14b1deb54d6cb7 100644 (file)
@@ -94,8 +94,11 @@ sub preprocess_toggleable (@) { #{{{
        my $id=genid($params{page}, $params{id});
 
        # Should really be a postprocessor directive, oh well. Work around
-       # markdown's dislike of markdown inside a <div>.
-       return "<div class=\"toggleable\" id=\"$id\"></div>\n\n$params{text}\n<div class=\"toggleableend\"></div>";
+       # markdown's dislike of markdown inside a <div> with various funky
+       # whitespace.
+       my ($indent)=$params{text}=~/( +)$/;
+       $indent="" unless defined $indent;
+       return "<div class=\"toggleable\" id=\"$id\"></div>\n\n$params{text}\n$indent<div class=\"toggleableend\"></div>";
 } # }}}
 
 sub format (@) { #{{{
index e408d5ac3c975e0c8409af513f4cd5310bc6bbf4..087f2508c3cc1b218d09d876da9515d4a29d6a59 100644 (file)
@@ -20,7 +20,7 @@ sub rcs_prepedit ($) {
        return ""
 }
 
-sub rcs_commit ($$$) {
+sub rcs_commit ($$$;$$) {
        # Tries to commit the page; returns undef on _success_ and
        # a version of the page with the rcs's conflict markers on failure.
        # The file is relative to the srcdir.
index 46adf16579bc02f7945159c9142f8f31ebd41010..05eaa8d78eba8f408bdaa4645a3eca28d31ea213 100644 (file)
@@ -294,12 +294,19 @@ sub rcs_prepedit ($) { #{{{
        return git_sha1($file);
 } #}}}
 
-sub rcs_commit ($$$) { #{{{
+sub rcs_commit ($$$;$$) { #{{{
        # Try to commit the page; returns undef on _success_ and
        # a version of the page with the rcs's conflict markers on
        # failure.
 
-       my ($file, $message, $rcstoken) = @_;
+       my ($file, $message, $rcstoken, $user, $ipaddr) = @_;
+
+       if (defined $user) {
+               $message="web commit by $user".(length $message ? ": $message" : "");
+       }
+       elsif (defined $ipaddr) {
+               $message="web commit from $ipaddr".(length $message ? ": $message" : "");
+       }
 
        # XXX: Wiki directory is in the unlocked state when starting this
        # action.  But it takes time for a Git process to finish its job
index 36972c560e3c6b6f5426610bb0209bce99b86b5f..66ff0996a619fd482846d43831954143cff1bf71 100644 (file)
@@ -66,7 +66,14 @@ sub rcs_prepedit ($) { #{{{
 } #}}}
 
 sub rcs_commit ($$$) { #{{{
-       my ($file, $message, $rcstoken) = @_;
+       my ($file, $message, $rcstoken, $user, $ipaddr) = @_;
+
+       if (defined $user) {
+               $message="web commit by $user".(length $message ? ": $message" : "");
+       }
+       elsif (defined $ipaddr) {
+               $message="web commit from $ipaddr".(length $message ? ": $message" : "");
+       }
 
        $message = possibly_foolish_untaint($message);
 
index fbf6b2c9ecc7be2556afe95cfa0ab11216731734..597295d44c44220a7a66999767d961d854e5cfec 100644 (file)
@@ -60,13 +60,22 @@ sub rcs_prepedit ($) { #{{{
        }
 } #}}}
 
-sub rcs_commit ($$$) { #{{{
+sub rcs_commit ($$$;$$) { #{{{
        # Tries to commit the page; returns undef on _success_ and
        # a version of the page with the rcs's conflict markers on failure.
        # The file is relative to the srcdir.
        my $file=shift;
        my $message=shift;
        my $rcstoken=shift;
+       my $user=shift;
+       my $ipaddr=shift;
+
+       if (defined $user) {
+               $message="web commit by $user".(length $message ? ": $message" : "");
+       }
+       elsif (defined $ipaddr) {
+               $message="web commit from $ipaddr".(length $message ? ": $message" : "");
+       }
 
        if (-d "$config{srcdir}/.svn") {
                # Check to see if the page has been changed by someone
index be5ec0601304d1c66c12f366c40d794975cd47fd..7254eb1a7f5cb6a87b4ea6b3d6aa18e34275c387 100644 (file)
@@ -38,10 +38,19 @@ sub rcs_prepedit ($) { #{{{
        }
 } #}}}
 
-sub rcs_commit ($$$) { #{{{
+sub rcs_commit ($$$;$$) { #{{{
        my $file=shift;
        my $message=shift;
        my $rcstoken=shift;
+       my $user=shift;
+       my $ipaddr=shift;
+
+       if (defined $user) {
+               $message="web commit by $user".(length $message ? ": $message" : "");
+       }
+       elsif (defined $ipaddr) {
+               $message="web commit from $ipaddr".(length $message ? ": $message" : "");
+       }
 
        if (-d "$config{srcdir}/{arch}") {
                # Check to see if the page has been changed by someone
index 02ea0b7b19c5e9bcf37aaac0379162b59efe5c6b..7d609b254e48cc14d69b17346eabab97338d51c4 100644 (file)
@@ -40,8 +40,11 @@ ikiwiki (1.34) UNRELEASED; urgency=low
   * Daemonize before sending commit mails, as that can also take a long
     time/hang if the mail server is unhappy.
   * Factor out commit mail sending code into new function.
+  * Change rcs_commit, it is now passed the name of the user doing the commit
+    and their IP address, and needs to construct its own commit message
+    containing them, or do something more appropriate for the given RCS.
 
- -- Joey Hess <joeyh@debian.org>  Tue, 21 Nov 2006 19:25:14 -0500
+ -- Joey Hess <joeyh@debian.org>  Wed, 22 Nov 2006 09:08:37 -0500
 
 ikiwiki (1.33) unstable; urgency=low
 
index 479cc46680a4c419b2e0e413ca5aa53a94a89fc7..22709f88d436635903a6ce80f5efab2b4113cfe6 100644 (file)
@@ -18,7 +18,8 @@ Thanks! --[[Joey]]
 """]]
 
 * [[Setup]] has a tutorial for setting up ikiwiki, and [[Usage]] documents
-  the parameters and usage of the ikiwiki program.
+  the parameters and usage of the ikiwiki program. There are some
+  [[examples]] of things you can do with ikiwiki.
 
 * [[Security]] lists potential security problems. ikiwiki is still being
   developed, and is being written with security as a priority, so don't