[Bps-public-commit] r9085 - SVKUI/trunk/lib/SVKUI
clsung at bestpractical.com
clsung at bestpractical.com
Wed Sep 19 00:43:36 EDT 2007
Author: clsung
Date: Wed Sep 19 00:43:34 2007
New Revision: 9085
Modified:
SVKUI/trunk/lib/SVKUI/View.pm
Log:
- yap, recovered. so the 'annotate' command is handled.
Modified: SVKUI/trunk/lib/SVKUI/View.pm
==============================================================================
--- SVKUI/trunk/lib/SVKUI/View.pm (original)
+++ SVKUI/trunk/lib/SVKUI/View.pm Wed Sep 19 00:43:34 2007
@@ -181,12 +181,12 @@
my (undef, $_rev, $_last, $_size, $_mon, $_day, $_time, $_name) = split / {1,12}/, $_relpath;
row {
if ($_relpath =~ m#/$#m) {
- cell {
+ cell { {class is 'name'}
Jifty->web->link (url => '/ia2/'.$mirror->name."/list?args=-v&path=$relpath/$_name", label => $_name, class => 'dir');
};
} else {
cell {
- Jifty->web->link (url => '/ia2/'.$mirror->name."/annotate?args=-v&path=$relpath/$_name", label => $_name, class => 'file');
+ Jifty->web->link (url => '/ia2/'.$mirror->name."/annotate?path=$relpath/$_name", label => $_name, class => 'file');
};
}
cell { {class is 'rev'} $_rev };
@@ -197,6 +197,38 @@
}
};
};
+ } elsif ($cmd eq 'annotate') {
+ my @lines = split /\n/, $command->output_raw;
+ my $last_rev = -1;
+ my $line_no = 0;
+ my @styles = ( '#e0e0e0', '#f7f7f7' );
+ my $index_style = 0;
+ table { {class is 'listing' } { id is 'dirlist' } {summary is 'Browse Listing'}
+ thead {
+ row {
+ th { 'Line #' }
+ th { {class is 'chgset' } 'Revision' }
+ th { {class is 'author' } 'Author' }
+ th {}
+ }
+ }
+ tbody {
+ for my $_line (@lines) {
+ warn $_line;
+ my ($_rev, $_author, $_time, $_content) = ($_line =~ m/^ *(\d+)\t+\( *(\w+) ([\d-]+)\):\t+(.*)$/);
+ next unless defined ($_rev);
+ $index_style = ($index_style + 1) % 2 if ($last_rev != $_rev);
+ row {
+ cell { $line_no };
+ cell { {class is 'chgset'} $_rev if ($last_rev != $_rev) };
+ cell { {class is 'author', align is 'center'} $_author };
+ cell { {style is "white-space: pre; background: $styles[$index_style];" } $_content }
+ }
+ $line_no++;
+ $last_rev = $_rev;
+ }
+ };
+ };
} else {
dl {
pre { outs($command->output_raw) };
More information about the Bps-public-commit
mailing list