/[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 1065 by dpavlin, Sat Jan 24 19:35:41 2009 UTC revision 1066 by dpavlin, Mon Apr 27 18:45:14 2009 UTC
# Line 8  use Moose; Line 8  use Moose;
8    
9  extends 'Frey';  extends 'Frey';
10  with 'Frey::Web';  with 'Frey::Web';
11  #with 'Frey::Storage';  with 'Frey::Storage';
12    with 'Frey::HTML::Diff';
13    
14  use XML::Simple;  use XML::Simple;
15  use DateTimeX::Easy;  use DateTimeX::Easy;
16    use Text::Diff::Parser;
17    
18  has repository => (  has repository => (
19          is => 'rw',          is => 'rw',
# Line 31  has limit => ( Line 33  has limit => (
33          default => 50,          default => 50,
34  );  );
35    
36    has include_diff => (
37            is => 'ro',
38            isa => 'Bool',
39            default => 1,
40    );
41    
42  sub iterator {  sub iterator {
43          my ($self,$coderef) = @_;          my ($self,$coderef) = @_;
44                    
# Line 57  sub iterator { Line 65  sub iterator {
65          warn "# path $path\n";          warn "# path $path\n";
66    
67          my $cmd;          my $cmd;
68            my $svn_path = $path;
69    
70          if ($path =~ m#file://# || -e "$path/.svn") {          if ($path =~ m#file://# || -e "$path/.svn") {
71                  $cmd = "svn log -v --xml $path";                  $cmd = "svn log -v --xml $path";
72          } else {          } else {
73                  my $svn_path = sh_regex('svk info', qr#Mirrored From:\s+([^,]+)#i);                  $svn_path = sh_regex('svk info', qr#Mirrored From:\s+([^,]+)#i);
74    
75                  if (! $svn_path) {                  if (! $svn_path) {
76    
# Line 97  sub iterator { Line 107  sub iterator {
107    
108          foreach my $e (@{$xml->{'logentry'}}) {          foreach my $e (@{$xml->{'logentry'}}) {
109                  warn "# e = ",$self->dump( $e ) if $self->debug;                  warn "# e = ",$self->dump( $e ) if $self->debug;
110    
111                    if ( $self->include_diff ) {
112                            my $rev = $e->{'revision'};
113                            my $file = $svn_path;
114                            $file =~ s{^\w+:/+}{};
115                            my $file = "var/svn/$path.diff";
116                            my $diff = $self->load( $file );
117                            if ( ! $diff ) {
118                                    $diff = `svn diff -c $rev $svn_path`;
119                                    $self->store( $file, $diff );
120                            }
121                            $e->{diff} .= $diff;
122                    }
123    
124                  $coderef->($e);                  $coderef->($e);
125          }          }
126  }  }
# Line 193  sub as_markup { Line 217  sub as_markup {
217                          $path_count->{$path}++;                          $path_count->{$path}++;
218                  }                  }
219    
220                    my $diff = $self->html_diff( $e->{diff} ) if $e->{diff};
221    
222                  $html .= qq|                  $html .= qq|
223                          <div class="commit">                          <div class="commit">
224                                  <span class="date">$date</span>                                  <span class="date">$date</span>
# Line 210  sub as_markup { Line 236  sub as_markup {
236                                  . qq|                                  . qq|
237                                  </div>                                  </div>
238                                  $msg                                  $msg
239                                    $diff
240                          </div>                          </div>
241                  |;                  |;
242    

Legend:
Removed from v.1065  
changed lines
  Added in v.1066

  ViewVC Help
Powered by ViewVC 1.1.26