Change By: Haijing Wei (26/Mar/13 2:39 PM)
Description: We have problem by incremental build jenkins 1.506 and gerrit-trigger 2.8.0. if we push for example 3 commit at once, only the last commit will be built.

The problem ist in com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerBuildChooser.prevBuildForChangelog().
 {color:red}  This methods return parent commit as last commit {color} , which let git-plugin build a wrong changelog.xml. and jenkins use this changelog.xml for incremental build.

Patch for this problem:

{code:title=GerritTriggerBuildChooser.java|borderStyle=solid}
--- a/gerrithudsontrigger/src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/GerritTriggerBuildChooser.java
+++ b/gerrithudsontrigger/src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/GerritTriggerBuildChooser.java
@@ -112,6 +112,14 @@
         // Now we cheat and add the parent as the last build on the branch, so we can
         // get the changelog working properly-ish.
         ObjectId parentSha1 = getFirstParent(sha1, git);
+        
+        if(data != null) {
+          Build b = data.getLastBuildOfBranch(singleBranch);
+          if(b != null) {
+            parentSha1 = b.getSHA1();
+          }
+        }
+        
         Revision parentRev = new Revision(parentSha1);
         parentRev.getBranches().add(new Branch(singleBranch, parentSha1));
  
{code}
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply via email to