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

Contents of /trunk/lib/Frey/SVK.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 498 - (show annotations)
Mon Nov 24 21:31:54 2008 UTC (15 years, 5 months ago) by dpavlin
File size: 565 byte(s)
show modified files and diff as_markup
1 package Frey::SVK;
2 use Moose;
3
4 with 'Frey::Escape';
5
6 sub modified {
7 my ($self) = @_;
8 my @modified;
9 open(my $svk, '-|', 'svk status -q') or die $@;
10 while(<$svk>) {
11 chomp;
12 push @modified, $1 if /^M\s+(.+)/;
13 }
14 return @modified;
15 }
16
17 sub as_data {
18 my ($self) = @_;
19 {
20 modified => [ $self->modified ],
21 }
22 }
23
24 sub as_markup {
25 my ($self) = @_;
26
27 my $status = `svk status -q`;
28 my $diff = `svk diff`;
29
30 my $html
31 = qq|<pre>$status</pre><hr><pre>|
32 . $self->html_escape( $diff )
33 . qq|</pre>|
34 ;
35 warn "diff ",length($html)," bytes";
36
37 return $html;
38 }
39
40 1;

  ViewVC Help
Powered by ViewVC 1.1.26