/[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 851 by dpavlin, Mon Dec 15 20:10:48 2008 UTC revision 909 by dpavlin, Fri Jan 2 16:56:42 2009 UTC
# Line 91  sub iterator { Line 91  sub iterator {
91          my $xml = XMLin($log, ForceArray => [ 'logentry', 'path' ]);          my $xml = XMLin($log, ForceArray => [ 'logentry', 'path' ]);
92    
93          foreach my $e (@{$xml->{'logentry'}}) {          foreach my $e (@{$xml->{'logentry'}}) {
94                  warn "# e = ",$self->dump( $e );                  warn "# e = ",$self->dump( $e ) if $self->debug;
95                  $coderef->($e);                  $coderef->($e);
96          }          }
97  }  }
# Line 108  sub as_markup { Line 108  sub as_markup {
108                  $foo =~ s/</&lt;/g;                  $foo =~ s/</&lt;/g;
109                  $foo =~ s/>/&gt;/g;                  $foo =~ s/>/&gt;/g;
110                  $foo =~ s/"/&quot;/g;                  $foo =~ s/"/&quot;/g;
111                  $foo =~ s/([\n\r][\n\r]+)/<\/p>$1<p>/gis;  #               $foo =~ s/([\n\r][\n\r]+)/$1<br\/>/gis;
112                  $foo =~ s/([\n\r]+)([\-\*]\s+)/$1<br\/>$2/gis;                  $foo =~ s/([\n\r]+)([\-\*]\s+)/$1<br\/>$2/gis;
113                  $foo =~ s/([\n\r]+)(r\d+:\s+)/$1<br\/>$2/gis;                  $foo =~ s/([\n\r]+)(r\d+:\s+)/$1<br\/>$2/gis;
114                  $foo =~ s/([\n\r]+)(\s+r\d+@)/$1<br\/>$2/gis;           # svk                  $foo =~ s/([\n\r]+)(\s+r\d+@)/$1<br\/>$2/gis;           # svk
# Line 116  sub as_markup { Line 116  sub as_markup {
116          }          }
117    
118          our $html = '';          our $html = '';
119          sub html {  
120                  $html .= join("\n", @_);          $self->add_css(qq|
121          }                  .commit {
122                            clear: both;
123                            padding-top: 1em;
124                            padding-bottom: 1em;
125                            border-top: 1px dashed #ccc;
126                    }
127                    .files {
128                            color: #888;
129                            font-family: monospace;
130                            font-size: 80%;
131                            float: right;
132                            padding-bottom: 1.2em; /* fix 80% back to original 1em */
133                    }
134                    .date, .revision { color: #666; }
135                    .message {
136                            padding-top: 0.5em;
137                            padding-left: 2em; /* like blockquote */
138                            white-space: pre-wrap;
139                    }
140    
141                    ins { color: #8c8 }
142                    del { color: #c88 }
143            |);
144    
145          $self->iterator( sub {          $self->iterator( sub {
146                  my $e = shift;                  my $e = shift;
# Line 129  sub as_markup { Line 151  sub as_markup {
151                  $date =~ s/T/ /;                  $date =~ s/T/ /;
152                  $date =~ s/\.\d+Z$//;                  $date =~ s/\.\d+Z$//;
153    
154                  html '<p><tt>'.$date.'</tt> <em>',$e->{'author'},'</em> <tt style="color:#808080">r',$e->{'revision'},'</tt></p>';                  my $msg = $e->{'msg'};
155                    $msg = '' if ref($msg); # FIXME why do I need this, dammit?
156                    if ( $msg ) {
157                            $msg = encode( $msg );
158                            $msg = qq|<div class="message">$msg</div>|;
159                    }
160    
161                  my @files;                  my @files;
162    
# Line 145  sub as_markup { Line 172  sub as_markup {
172                          }                          }
173                  }                  }
174    
175                  my $msg = $e->{'msg'};                  $html .= qq|
176                  $msg = '' if ref($msg); # FIXME why do I need this, dammit?                          <div class="commit">
177                  $msg = encode( $msg );                          <span class="date">$date</span>
178                            <em>$e->{author}</em>
179                  html '<blockquote><p><tt style="color:#808080">',join(", ",@files),'</tt> ',$msg,'</p></blockquote>';                          <span class="revision">$e->{revision}</span>
180                            <div class="files">\n| . join("<br>\n",@files) . qq|\n</div>
181                            $msg
182                            </div>
183                    |;
184    
185          });          });
186    

Legend:
Removed from v.851  
changed lines
  Added in v.909

  ViewVC Help
Powered by ViewVC 1.1.26