]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
basically, removal works
authorJoey Hess <joey@kodama.kitenet.net>
Mon, 21 Jul 2008 17:50:12 +0000 (13:50 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Mon, 21 Jul 2008 17:50:12 +0000 (13:50 -0400)
Still need to consider all the edge cases..

IkiWiki/Plugin/remove.pm
debian/changelog

index 0dded4fa4b7d44285a389c54dadefa00b2db8d65..57c43cfdf4db1b033d19541b77d1893889e227fd 100644 (file)
@@ -106,7 +106,23 @@ sub sessioncgi ($$) { #{{{
                        exit 0;
                }
                elsif ($form->submitted eq 'Remove' && $form->validate) {
-                       error("removal not yet implemented"); # TODO
+                       my $page=IkiWiki::titlepage($form->field("page"));
+                       my $file=$pagesources{$page};
+
+                       # Do removal, and update the wiki.
+                       require IkiWiki::Render;
+                       if ($config{rcs}) {
+                               IkiWiki::rcs_remove($file);
+                               IkiWiki::disable_commit_hook();
+                               IkiWiki::rcs_commit($file, gettext("removed"),
+                                       IkiWiki::rcs_prepedit($file),
+                                       $session->param("name"), $ENV{REMOTE_ADDR});
+                               IkiWiki::enable_commit_hook();
+                               IkiWiki::rcs_update();
+                       }
+                       IkiWiki::prune("$config{srcdir}/$file");
+                       IkiWiki::refresh();
+                       IkiWiki::saveindex();
                }
                else {
                        IkiWiki::showform($form, $buttons, $session, $q);
index 1c7d03b9718e03187486e92322030a5ad04955ae..7fd149df5a3337db782eb1733f50e139764a879c 100644 (file)
@@ -3,7 +3,7 @@ ikiwiki (2.55) UNRELEASED; urgency=low
   * prefix_directives enabled in doc wiki, all preprocessor directives
     converted. (Simon McVittie)
   * editpage: Don't show attachments link when attachments are disabled.
-  * All rcs backends need to implement rcs_rm. (Done for svn, git).
+  * All rcs backends need to implement rcs_remove. (Done for svn, git).
 
  -- Joey Hess <joeyh@debian.org>  Mon, 21 Jul 2008 11:35:46 -0400