commit autocreated tag pages
authorJoey Hess <joey@kitenet.net>
Wed, 21 Apr 2010 20:13:37 +0000 (16:13 -0400)
committerJoey Hess <joey@kitenet.net>
Wed, 21 Apr 2010 20:13:37 +0000 (16:13 -0400)
IkiWiki/Plugin/tag.pm

index d2a3d4dfdb5a3366262afd8c5a7159648a41cbc0..c98dd80b29620434087db459ff93a55dff7a5dee 100644 (file)
@@ -79,11 +79,18 @@ sub gentag ($) {
                my $tagfile = newpagefile($tagpage, $config{default_pageext});
 
                add_autofile($tagfile, "tag", sub {
-                       debug(sprintf(gettext("creating tag page %s"), $tag));
+                       my $message=sprintf(gettext("creating tag page %s"), $tag);
+                       debug($message);
 
                        my $template=template("autotag.tmpl");
                        $template->param(tag => $tag);
                        writefile($tagfile, $config{srcdir}, $template->output);
+                       if ($config{rcs}) {
+                               IkiWiki::disable_commit_hook();
+                               IkiWiki::rcs_add($tagfile);
+                               IkiWiki::rcs_commit_staged($message, undef, undef);
+                               IkiWiki::enable_commit_hook();
+                       }
                });
        }
 }