diff --git a/framework/core/Project/Closure.pm b/framework/core/Project/Closure.pm index 688f32b66..4c83b9325 100644 --- a/framework/core/Project/Closure.pm +++ b/framework/core/Project/Closure.pm @@ -68,7 +68,15 @@ sub determine_layout { sub _post_checkout { @_ == 3 or die $ARG_ERROR; my ($self, $rev_id, $work_dir) = @_; - my $vid = $self->{_vcs}->lookup_vid($rev_id); + # get original bid + my $bid; + if (-e "$work_dir/$CONFIG") { + my $config = Utils::read_config_file("$work_dir/$CONFIG"); + if (defined $config) { + $bid = $config->{$CONFIG_VID}; + } else { die "no .config file"; } + } else { die "no .config file"; } + chop($bid); open FH, "$work_dir/build.xml" or die $!; my $build_file = do { local $/; }; @@ -87,8 +95,9 @@ sub _post_checkout { my @entries = readdir(DIR); closedir(DIR); foreach my $file (@entries) { + if ($file =~ /-(\d+)-(\d+).diff/) { - if ($vid >= $1 && $vid <= $2) { + if ($bid >= $1 && $bid <= $2) { $self->apply_patch($work_dir, "$compile_errors/$file") or confess("Couldn't apply patch ($file): $!"); } diff --git a/framework/projects/Closure/compile-errors/test-107-109.diff b/framework/projects/Closure/compile-errors/test-107-109.diff new file mode 100644 index 000000000..fb59b4b47 --- /dev/null +++ b/framework/projects/Closure/compile-errors/test-107-109.diff @@ -0,0 +1,32 @@ +diff --git a/test/com/google/debugging/sourcemap/SourceMapConsumerV3Test.java b/test/com/google/debugging/sourcemap/SourceMapConsumerV3Test.java +index 0364059cf..39a501b45 100644 +--- a/test/com/google/debugging/sourcemap/SourceMapConsumerV3Test.java ++++ b/test/com/google/debugging/sourcemap/SourceMapConsumerV3Test.java +@@ -20,6 +20,7 @@ import junit.framework.TestCase; + + import org.json.JSONArray; + ++import java.util.Collection; + import java.util.Map; + + /** +@@ -41,7 +41,8 @@ public class SourceMapConsumerV3Test extends TestCase { + SourceMapConsumerV3 consumer = new SourceMapConsumerV3(); + consumer.parse(sourceMap); + +- String[] sources = (String[]) consumer.getOriginalSources().toArray(); ++ Collection temp = consumer.getOriginalSources(); ++ String[] sources = temp.toArray(new String[0]); + + assertEquals(1, sources.length); + assertEquals(null, consumer.getSourceRoot()); +@@ -62,7 +63,8 @@ public class SourceMapConsumerV3Test extends TestCase { + SourceMapConsumerV3 consumer = new SourceMapConsumerV3(); + consumer.parse(sourceMap); + +- String[] sources = (String[]) consumer.getOriginalSources().toArray(); ++ Collection temp = consumer.getOriginalSources(); ++ String[] sources = temp.toArray(new String[0]); + + assertEquals(1, sources.length); + assertEquals("http://server/path/", consumer.getSourceRoot()); diff --git a/framework/projects/Closure/compile-errors/test-175-176.diff b/framework/projects/Closure/compile-errors/test-175-176.diff new file mode 100644 index 000000000..fb59b4b47 --- /dev/null +++ b/framework/projects/Closure/compile-errors/test-175-176.diff @@ -0,0 +1,32 @@ +diff --git a/test/com/google/debugging/sourcemap/SourceMapConsumerV3Test.java b/test/com/google/debugging/sourcemap/SourceMapConsumerV3Test.java +index 0364059cf..39a501b45 100644 +--- a/test/com/google/debugging/sourcemap/SourceMapConsumerV3Test.java ++++ b/test/com/google/debugging/sourcemap/SourceMapConsumerV3Test.java +@@ -20,6 +20,7 @@ import junit.framework.TestCase; + + import org.json.JSONArray; + ++import java.util.Collection; + import java.util.Map; + + /** +@@ -41,7 +41,8 @@ public class SourceMapConsumerV3Test extends TestCase { + SourceMapConsumerV3 consumer = new SourceMapConsumerV3(); + consumer.parse(sourceMap); + +- String[] sources = (String[]) consumer.getOriginalSources().toArray(); ++ Collection temp = consumer.getOriginalSources(); ++ String[] sources = temp.toArray(new String[0]); + + assertEquals(1, sources.length); + assertEquals(null, consumer.getSourceRoot()); +@@ -62,7 +63,8 @@ public class SourceMapConsumerV3Test extends TestCase { + SourceMapConsumerV3 consumer = new SourceMapConsumerV3(); + consumer.parse(sourceMap); + +- String[] sources = (String[]) consumer.getOriginalSources().toArray(); ++ Collection temp = consumer.getOriginalSources(); ++ String[] sources = temp.toArray(new String[0]); + + assertEquals(1, sources.length); + assertEquals("http://server/path/", consumer.getSourceRoot());