--- svn/index.cgi 2008/10/17 10:09:15 18 +++ svn/index.cgi 2008/10/20 19:41:49 30 @@ -12,23 +12,24 @@ my $debug = $ENV{'DEBUG'} || 0; -my $max_items = 500; +my $limit = 1000; my $repository_dir = '/srv/svn'; my $svnweb = 'https://svn-strix.carnet.hr/private/svnweb/index.cgi/%s/revision?rev=%d'; -my $strip_branch = s!^/(branches/)?[^/]+/!/!; # my local config for development $repository_dir = '/home/dpavlin/private/svn'; $svnweb = 'http://localhost/svnweb/index.cgi/%s/revision?rev=%d'; -$strip_branch = s!!!; +# my local svk mirrors +$repository_dir = '/home/dpavlin/.svk'; +$svnweb = 'http://localhost/svnweb/svk/index.cgi/%s/revision?rev=%d'; # for older JSON #sub encode_json { objToJson( @_ ) } sub path_strip { my $path = shift; - $path =~ $strip_branch; +# $path =~ $strip_branch; return $path; } @@ -38,14 +39,24 @@ our $q = CGI->new; my $repository = $q->param('repository'); -$repository = (grep { m/^\Q$repository\E$/ } @repositories )[0]; +$repository = (grep { m/^\Q$repository\E$/ } @repositories )[0] if $repository; + +warn "q = ",dump( $q ); +warn "# limit: ", $q->param('limit'); sub select_repository { - $q->start_form( -name => 'current_repository', -id => 'current_repository', -method => 'post' ), - "Select repository: ", - $q->popup_menu( -name => 'repository', -values => [ @repositories ], -onChange => qq{document.getElementById('current_repository').submit();} ), - $q->submit, - $q->end_form; + my $onChange = qq{document.getElementById('current_repository').submit();}; + return ( + $q->start_form( -name => 'current_repository', -id => 'current_repository', -method => 'post' ), + "From repository ", + $q->popup_menu( -name => 'repository', -values => [ @repositories ], -onChange => $onChange ), + " show ", + $q->popup_menu( -name => 'limit', -values => [ qw/100 500 1000 5000 10000/ ], -onChange => $onChange ), + " revisions with ", + $q->checkbox(-name=>'path', -checked=>1, -value=>'ON', -label=>'path modifications', -onChange => $onChange ), + $q->submit, + $q->end_form + ); } if ( ! $repository ) { @@ -60,7 +71,7 @@ + href="|, $q->url( -query => 1 ), qq|&json=1" />