[Bps-public-commit] Test-Chimps-Client branch, master, updated. acfb6d45e03519cd651972f75466086167107041

sunnavy at bestpractical.com sunnavy at bestpractical.com
Tue Jun 23 07:40:23 EDT 2009


The branch, master has been updated
       via  acfb6d45e03519cd651972f75466086167107041 (commit)
      from  c714db23a827b9c9e2a6cf1b444e77842446f210 (commit)

Summary of changes:
 lib/Test/Chimps/Smoker.pm     |    1 +
 lib/Test/Chimps/Smoker/Git.pm |   17 ++++++++++++++++-
 lib/Test/Chimps/Smoker/SVN.pm |   10 ++++++++--
 3 files changed, 25 insertions(+), 3 deletions(-)

- Log -----------------------------------------------------------------
commit acfb6d45e03519cd651972f75466086167107041
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue Jun 23 19:24:48 2009 +0800

    add committed_date column

diff --git a/lib/Test/Chimps/Smoker.pm b/lib/Test/Chimps/Smoker.pm
index e2bb662..7260acf 100644
--- a/lib/Test/Chimps/Smoker.pm
+++ b/lib/Test/Chimps/Smoker.pm
@@ -279,6 +279,7 @@ sub _smoke_once {
                 project   => $project,
                 revision  => $revision,
                 committer => $next{'committer'},
+                committed_date => $next{'committed_date'},
                 osname    => $Config{osname},
                 osvers    => $Config{osvers},
                 archname  => $Config{archname},
diff --git a/lib/Test/Chimps/Smoker/Git.pm b/lib/Test/Chimps/Smoker/Git.pm
index 9aadf20..e9b69f2 100644
--- a/lib/Test/Chimps/Smoker/Git.pm
+++ b/lib/Test/Chimps/Smoker/Git.pm
@@ -36,6 +36,16 @@ sub committer {
     return $committer;
 }
 
+sub committed_date {
+    my $self = shift;
+    my $revision = shift;
+
+    my $cmd = 'git log -n1'. ($revision? " $revision" : '');
+    my ($date) = (`$cmd` =~ m/^date:\s*(.*)$/im);
+
+    return $date;
+}
+
 sub clone {
     my $self = shift;
 
@@ -77,8 +87,13 @@ sub next {
     }
 
     my $committer = $self->committer($revision);
+    my $committed_date = $self->committed_date($revision);
 
-    return (revision => $revision, committer => $committer);
+    return (
+        revision       => $revision,
+        committer      => $committer,
+        committed_date => $committed_date,
+    );
 }
 
 sub run_cmd {
diff --git a/lib/Test/Chimps/Smoker/SVN.pm b/lib/Test/Chimps/Smoker/SVN.pm
index d51a996..504f5ea 100644
--- a/lib/Test/Chimps/Smoker/SVN.pm
+++ b/lib/Test/Chimps/Smoker/SVN.pm
@@ -55,10 +55,16 @@ sub next {
 
     my $revision = $self->config->{revision};
     my $cmd = "svn log --limit 1 -q -r ". ($revision+1) .":HEAD ". $self->uri;
-    my ($next, $committer) = (`$cmd` =~ m/^r([0-9]+)\s+\|\s*(.*?)\s*\|/m);
+    my ( $next, $committer, $committed_date ) =
+      ( `$cmd` =~ m/^r([0-9]+)\s+\|\s*(.*?)\s*\|\s*([^(]*)/m );
     return () unless $next;
 
-    return (revision => $next, committer => $committer);
+    return (
+        revision       => $revision,
+        committer      => $committer,
+        committed_date => $committed_date,
+    );
+
 }
 
 sub run_cmd {

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list