[Bps-public-commit] r15578 - in sd/branches/sd-trunk: lib/App/SD/CLI/Command

jesse at bestpractical.com jesse at bestpractical.com
Wed Aug 27 21:25:03 EDT 2008


Author: jesse
Date: Wed Aug 27 21:24:59 2008
New Revision: 15578

Modified:
   sd/branches/sd-trunk/   (props changed)
   sd/branches/sd-trunk/lib/App/SD/CLI/Command/Log.pm

Log:
 r44637 at 192:  jesse | 2008-08-27 16:41:30 -0700
 * slightly better display of comments in ticket history


Modified: sd/branches/sd-trunk/lib/App/SD/CLI/Command/Log.pm
==============================================================================
--- sd/branches/sd-trunk/lib/App/SD/CLI/Command/Log.pm	(original)
+++ sd/branches/sd-trunk/lib/App/SD/CLI/Command/Log.pm	Wed Aug 27 21:24:59 2008
@@ -6,6 +6,7 @@
     my $self      = shift;
     my $changeset = shift;
     print $changeset->as_string(
+        skip_empty => 1,
         change_filter => sub {
             my $change = shift;
             return undef if $change->record_type eq '_merge_tickets';
@@ -17,10 +18,10 @@
         },
         header_callback => sub {
             my $c = shift;
-            sprintf "Change %d by %s at %s\n",
-                $c->sequence_no,
-                ( $c->creator || '(unknown)' ),
+            sprintf "%s - %s @ %s\n",
                 $c->created,
+                ( $c->creator || '(unknown)' ),
+                $c->original_source_uuid
                 ;
             }
 
@@ -48,6 +49,22 @@
     }
 }
 
+
+sub change_header_comment {
+    my $self = shift;
+    my $change = shift;
+    require App::SD::Model::Comment;
+    my $c = App::SD::Model::Comment->new( handle => $self->handle, type => App::SD::Model::Comment->type);
+    $c->load(uuid => $change->record_uuid);
+    warn "getting ticket";
+    if ($c->prop('ticket')) {
+    my $t = $c->ticket;
+    return " # Comment on ticket " . $t->luid . " (".$t->prop('summary').")"
+    } else {
+        return "# Comment on unknown ticket";
+    }
+}
+
 sub change_header_ticket {
     my $self = shift;
     my $change = shift;



More information about the Bps-public-commit mailing list