X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/b715f1041cddec4204d9ba73bb3f0caba596c0cb..644f78660c21302e0fa82c36fb6425d12d2b872a:/ikiwiki diff --git a/ikiwiki b/ikiwiki index 6cbaf8972..6ff0b1e8a 100755 --- a/ikiwiki +++ b/ikiwiki @@ -350,11 +350,17 @@ sub rcs_commit ($) { } } -sub rcs_ad ($) { +sub rcs_add ($) { my $file=shift; if (-d "$srcdir/.svn") { - if (system("svn", "add", "--quiet", $file) != 0) { + my $parent=dirname($file); + while (! -d "$srcdir/$parent/.svn") { + $file=$parent; + $parent=dirname($file); + } + + if (system("svn", "add", "--quiet", "$srcdir/$file") != 0) { warn("svn add failed\n"); } } @@ -585,6 +591,7 @@ sub cgi () { $page=~/$wiki_file_prune_regexp/ || $page=~/^\//) { error("bad page name"); } + $page=lc($page); my $action=$q->request_uri; $action=~s/\?.*//; @@ -596,7 +603,6 @@ sub cgi () { } my @page_locs; - my $default_loc=""; my ($from)=$q->param('from')=~/$wiki_file_regexp/; if (! defined $from || ! length $from || $from ne $q->param('from') || @@ -604,13 +610,13 @@ sub cgi () { @page_locs=$page; } else { - @page_locs="$from/$page"; - $from=dirname($from); + my $dir=$from."/"; + $dir=~s![^/]+/$!!; + push @page_locs, $dir.$page; push @page_locs, "$from/$page"; - $default_loc="$from/$page"; - while (length $from) { - $from=dirname($from); - push @page_locs, "$from/$page"; + while (length $dir) { + $dir=~s![^/]+/$!!; + push @page_locs, $dir.$page; } } @@ -620,13 +626,14 @@ sub cgi () { $q->h1("$wikiname: Creating $page"), $q->start_form(-action => $action), $q->hidden('do'), - $q->popup_menu('page', \@page_locs, $default_loc), + "Select page location:", + $q->popup_menu('page', \@page_locs), $q->textarea(-name => 'content', -default => "", -rows => 20, -columns => 80), $q->br, - "Optional comment about this change", + "Optional comment about this change:", $q->br, $q->textfield(-name => "comments", -size => 80), $q->br, @@ -652,7 +659,7 @@ sub cgi () { -rows => 20, -columns => 80), $q->br, - "Optional comment about this change", + "Optional comment about this change:", $q->br, $q->textfield(-name => "comments", -size => 80), $q->br,