--- trunk/lib/Frey/SVN.pm 2008/12/10 22:49:31 804 +++ trunk/lib/Frey/SVN.pm 2008/12/15 20:10:48 851 @@ -11,6 +11,7 @@ #with 'Frey::Storage'; use XML::Simple; +use DateTimeX::Easy; has repository => ( is => 'rw', @@ -139,16 +140,50 @@ push @files, "$path"; } elsif ($action eq "D") { push @files, "$path"; - } else{ + } else { push @files, $path; } } - html '

',join(", ",@files),': ',encode($e->{'msg'}),'

'; + my $msg = $e->{'msg'}; + $msg = '' if ref($msg); # FIXME why do I need this, dammit? + $msg = encode( $msg ); + + html '

',join(", ",@files),' ',$msg,'

'; }); return $html; } +sub codeswarm_as_markup { + my ($self) = @_; + + $self->content_type('text/xml'); + + my $file_events = ''; + + $self->iterator( sub { + my $e = shift; + + my $rev = $e->{'revision'}; + my $date = DateTimeX::Easy->new( $e->{'date'} )->epoch . '000'; # ms + my $author = $e->{'author'}; + + foreach my $p (@{$e->{'paths'}->{'path'}}) { + my ($action,$path) = ($p->{'action'},$p->{'content'}); + $file_events .= qq|\t\n|; + } + + }); + + return qq| + + + $file_events + + |; + +} + 1;