[Bps-public-commit] r9109 - in SVKUI: trunk/lib/SVKUI/View

clsung at bestpractical.com clsung at bestpractical.com
Fri Sep 21 04:23:35 EDT 2007


Author: clsung
Date: Fri Sep 21 04:23:32 2007
New Revision: 9109

Modified:
   SVKUI/   (props changed)
   SVKUI/trunk/lib/SVKUI/View/browse.pm

Log:
 r9189 at going04:  clsung | 2007-09-21 16:23:28 +0800
 - refine 'log' output


Modified: SVKUI/trunk/lib/SVKUI/View/browse.pm
==============================================================================
--- SVKUI/trunk/lib/SVKUI/View/browse.pm	(original)
+++ SVKUI/trunk/lib/SVKUI/View/browse.pm	Fri Sep 21 04:23:32 2007
@@ -87,9 +87,8 @@
     my $self = shift;
     my $output_raw = get('output_raw');
     my %fields = parse_log($output_raw);
-    use Data::Dumper;
-    warn Dumper(%fields);
     my $rev = get('rev');
+    my %modes = ( 'M' => 'mod', 'A' => 'add', 'D' => 'rem' );
     h1 { "Revision $rev"}
     dl { {id is 'overview'}
 	dt { {class is 'time'} 'Date:' }
@@ -97,14 +96,18 @@
 	dt { {class is 'author'} 'Author:' }
 	dd { {class is 'author'} $fields{'author'} }
 	dt { {class is 'message'} 'Revision Log:' }
-	dd { {class is 'message'} $fields{'message'} }
+	dd { {class is 'message'} 
+	    foreach my $_message (@{$fields{'message'}}) {
+		outs( $_message ); br { }
+	    }
+	}
 	dt { {class is 'files'} 'Files:' }
 	dd { {class is 'files'} 
 	    ul {
-		foreach my $_file (@{$fields{'files'}}) {
+		foreach my $_file (keys %{$fields{'files'}}) {
 		    li {
-			div { {class is 'mod'} }
-			$_file
+			div { {class is $modes{$fields{'files'}{$_file}} } };
+			outs ($_file);
 		    }
 		}
 	    }
@@ -117,14 +120,22 @@
     my @lines = split /\n/, $output_raw;
     my %fields;
 #    r2 (orig r2411):  clsung | 2007-06-21 09:09:40 +0800 
+    my $begin_message = 0;
     foreach my $_line (@lines) {
+	next if $_line =~ m/^-+$/;
 	if ($_line =~ m/^ *r\d+(?: \(orig r\d+\))?: *(\w+) \| ([-\d: +]+)/) {
 	    ($fields{'author'}, $fields{'time'}) = ($1,$2);
+	} elsif ($_line =~ m#^  ([AMD])  (/[^\s]+)#) {
+	    $fields{'files'}{$2} = $1;
+	} elsif (!$_line or $_line eq'') {
+	    $begin_message = 1;
+	} elsif ($begin_message) {
+	    push @{$fields{'message'}},$_line;
+#	} else {
+#	    warn $_line;
 	}
 	#($fields{'author'}, $fields{'time'}) = ($_line =~ m/^ *r\d+(?: \(orig r\d+\))?: *(\w+) \| ([-\d: +]+)/);
     }
-    $fields{'message'} = 'bc';
-    push @{$fields{'files'}},"N/A";
     return %fields;
 };
 



More information about the Bps-public-commit mailing list