/[Frey]/trunk/lib/Frey/SVN.pm
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 /trunk/lib/Frey/SVN.pm

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

revision 1072 by dpavlin, Tue Apr 28 17:04:24 2009 UTC revision 1073 by dpavlin, Tue Apr 28 22:36:26 2009 UTC
# Line 216  sub as_markup { Line 216  sub as_markup {
216    
217          my $max_path_len = 0;          my $max_path_len = 0;
218          my $path_count;          my $path_count;
219            my $stats;
220    
221          $self->iterator( sub {          $self->iterator( sub {
222                  my $e = shift;                  my $e = shift;
# Line 248  sub as_markup { Line 249  sub as_markup {
249    
250                          $max_path_len = length $path if length $path > $max_path_len;                          $max_path_len = length $path if length $path > $max_path_len;
251                          $path_count->{$path}++;                          $path_count->{$path}++;
252    
253                            if ( my $added = $e->{diff_paths}->{$path}->{added} ) {
254                                    $stats->{total_added} += $added;
255                            }
256    
257                            if ( my $removed = $e->{diff_paths}->{$path}->{removed} ) {
258                                    $stats->{total_removed} += $removed;
259                            }
260                  }                  }
261    
262                  my $diff = $self->html_diff( $e->{diff} ) if $e->{diff};                  my $diff = $self->html_diff( $e->{diff} ) if $e->{diff};
# Line 299  sub as_markup { Line 308  sub as_markup {
308    
309          });          });
310    
311            $max_path_len +=
312                  length( $stats->{total_added} )
313                    + length( $stats->{total_removed} )
314                    ;
315    
316            $max_path_len += int( $max_path_len / 10 ); # we are using ex, so we add 10%
317    
318          $self->add_css(qq|          $self->add_css(qq|
319                  .files {                  .files {
320                          width: ${max_path_len}ex;                          width: ${max_path_len}ex;
# Line 307  sub as_markup { Line 323  sub as_markup {
323    
324          $html =~ s[title="(\S+) ##"]['title="' . $path_count->{$1} . '"']gse;          $html =~ s[title="(\S+) ##"]['title="' . $path_count->{$1} . '"']gse;
325    
326            $html .= $self->dump( 'stats', $stats );
327    
328          return $html;          return $html;
329  }  }
330    
# Line 328  sub codeswarm_as_markup { Line 346  sub codeswarm_as_markup {
346                          my ($action,$path) = ($p->{'action'},$p->{'content'});                          my ($action,$path) = ($p->{'action'},$p->{'content'});
347                          my $weight = '';                          my $weight = '';
348                          if ( my $s = $e->{diff_paths}->{$path} ) {                          if ( my $s = $e->{diff_paths}->{$path} ) {
   
                                 warn $self->dump( $s );  
349                                  $weight  = $s->{removed}   if defined $s->{removed};                                  $weight  = $s->{removed}   if defined $s->{removed};
350                                  $weight += $s->{added} * 2 if defined $s->{added};                                  $weight += $s->{added} * 2 if defined $s->{added};
351                                  $weight  = qq| weight="$weight" |;                                  $weight  = qq| weight="$weight" |;

Legend:
Removed from v.1072  
changed lines
  Added in v.1073

  ViewVC Help
Powered by ViewVC 1.1.26