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

Alex Vandiver alexmv at bestpractical.com
Thu May 27 00:25:23 EDT 2010


The branch, master has been updated
       via  9915da70ba6bfead7116815512595889a272879c (commit)
      from  19fdc88fa412d8b0f979a7f93ea2062b6bab8174 (commit)

Summary of changes:
 lib/Test/Chimps/Smoker/Git.pm |   14 +++++---------
 1 files changed, 5 insertions(+), 9 deletions(-)

- Log -----------------------------------------------------------------
commit 9915da70ba6bfead7116815512595889a272879c
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Thu May 27 00:25:56 2010 -0400

    Better removal of previously-seen parents

diff --git a/lib/Test/Chimps/Smoker/Git.pm b/lib/Test/Chimps/Smoker/Git.pm
index 901b230..c24908f 100644
--- a/lib/Test/Chimps/Smoker/Git.pm
+++ b/lib/Test/Chimps/Smoker/Git.pm
@@ -106,15 +106,11 @@ sub store_tested_revision {
     my @oldrefs = split ' ', $self->revision;
     my $branch = $self->branch;
 
-    # We need to determine if we can simplify the list of refs that
-    # we've seen.  If the new ref is good enough to block off all of
-    # the other pending refs (it's a merge commit, a child of all of
-    # them), then we only need to store it; otherwise, we append.
-    my $with_prev = `git rev-list refs/remotes/origin/$branch ^$ref @{[map {"^$_"} @oldrefs]}`;
-    my $only_new  = `git rev-list refs/remotes/origin/$branch ^$ref`;
-
-    return $ref if $with_prev eq $only_new;
-    return "$ref @oldrefs";
+    # Drop anything which is a parent of what we've tested.
+    my %parents;
+    my @commits = split /\n/, `git rev-list --parents $ref @oldrefs`;
+    $parents{$_} = 1 for map {my($sha, at parents) = split; @parents} @commits;
+    return join(" ", grep {not $parents{$_}} $ref, @oldrefs);
 }
 
 sub run_cmd {

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



More information about the Bps-public-commit mailing list