/[simile]/svn/index.cgi
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /svn/index.cgi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 14 by dpavlin, Sun Oct 5 18:45:10 2008 UTC revision 15 by dpavlin, Mon Oct 6 09:41:28 2008 UTC
# Line 13  my $debug = 0; Line 13  my $debug = 0;
13    
14  my $max_items = 500;  my $max_items = 500;
15    
16  my $repository = 'file:///home/dpavlin/.svk/strix4/';  my $repository = 'file:///srv/svn/strix/';
17  my $svnweb = 'http://localhost/svnweb/svk/index.cgi/strix4/revision?rev=';  my $svnweb = 'https://svn-strix.carnet.hr/private/svnweb/index.cgi/strix/revision?rev=';
18    
19    # for older JSON
20    sub encode_json { objToJson( @_ ) }
21    
22    sub path_strip {
23            my $path = shift;
24    #       $path =~ s!^/[^/]+/[^/]+/!/!;
25            $path =~ s!^/(branches/)?[^/]+/!/!;
26            return $path;
27    }
28    
29  my $json = {  my $json = {
30          properties => {          properties => {
# Line 43  warn dump( $xml ) if $debug; Line 53  warn dump( $xml ) if $debug;
53  foreach my $e (@{$xml->{'logentry'}}) {  foreach my $e (@{$xml->{'logentry'}}) {
54    
55          foreach my $p (@{$e->{'paths'}->{'path'}}) {          foreach my $p (@{$e->{'paths'}->{'path'}}) {
56                  my $label = $e->{'revision'} . ' - ' . $p->{'content'};                  my $path = delete( $p->{'content'} );
57                    my $label = $e->{'revision'} . ' - ' . path_strip( $path );
58                  my $item = {                  my $item = {
59                          type => 'Item',                          type => 'Item',
60                          id => $label,                          id => $label,
61                          label => $label,                          label => $label,
62                          uri => $svnweb . $e->{'revision'},                          uri => $svnweb . $e->{'revision'},
63                          path => delete( $p->{'content'} ),                          path_full => $path,
64                            path => path_strip( $path ),
65                  };                  };
66    
67                  $item->{$_} = $p->{$_} foreach keys %$p;                  $item->{$_} = $p->{$_} foreach grep { ! defined $item->{$_} } keys %$p;
68                  $item->{$_} = $e->{$_} foreach grep { ! /^(paths)$/ } keys %$e;                  $item->{$_} = $e->{$_} foreach grep { ! defined $item->{$_} && ! /^(paths)$/ } keys %$e;
   
                 $item->{'path'} =~ s!^/[^/]+/[^/]+/!/!;  
69    
70                  warn dump( $item ) if $debug;                  warn dump( $item ) if $debug;
71    

Legend:
Removed from v.14  
changed lines
  Added in v.15

  ViewVC Help
Powered by ViewVC 1.1.26