Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[JENKINS-10255] Add more tests for polling, and fix a bug with the ne…
…w polling when multiple changesets are involved.
- Loading branch information
Showing
4 changed files
with
110 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -282,14 +282,14 @@ protected PollingResult compareRemoteRevisionWith(AbstractProject<?, ?> project, | |
|
||
ArgumentListBuilder logCmd = findHgExe(node, listener, false); | ||
logCmd.add("log", "--style", tmpFile.getRemote()); | ||
logCmd.add("--rev", ".:" + getBranch(), "--branch", getBranch()); | ||
logCmd.add("--prune", "."); | ||
logCmd.add("--branch", getBranch()); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
jglick
Member
|
||
logCmd.add("--no-merges"); | ||
|
||
ByteArrayOutputStream baos = new ByteArrayOutputStream(); | ||
ForkOutputStream fos = new ForkOutputStream(baos, output); | ||
|
||
if (forest) { | ||
logCmd.add("--prune", "."); | ||
StringTokenizer trees = new StringTokenizer(hg.popen(repository, listener, false, new ArgumentListBuilder("ftrees", "--convert"))); | ||
while (trees.hasMoreTokens()) { | ||
String tree = trees.nextToken(); | ||
|
@@ -298,12 +298,13 @@ protected PollingResult compareRemoteRevisionWith(AbstractProject<?, ?> project, | |
true, listener); | ||
} | ||
} else { | ||
logCmd.add("--prune", baseline.id); | ||
joinWithPossibleTimeout( | ||
launch(launcher).cmds(logCmd).stdout(fos).pwd(repository), | ||
true, listener); | ||
} | ||
|
||
MercurialTagAction cur = parseIncomingOutput(baos, baseline, changedFileNames); | ||
MercurialTagAction cur = parsePollingLogOutput(baos, baseline, changedFileNames); | ||
return new PollingResult(baseline,cur,computeDegreeOfChanges(changedFileNames,output)); | ||
} finally { | ||
tmpFile.delete(); | ||
|
@@ -371,7 +372,7 @@ private Set<String> dependentChanges(Set<String> changedFileNames) { | |
|
||
private static Pattern FILES_LINE = Pattern.compile("files:(.*)"); | ||
|
||
private MercurialTagAction parseIncomingOutput(ByteArrayOutputStream output, MercurialTagAction baseline, Set<String> result) throws IOException { | ||
private MercurialTagAction parsePollingLogOutput(ByteArrayOutputStream output, MercurialTagAction baseline, Set<String> result) throws IOException { | ||
String headId = null; // the tip of the remote revision | ||
BufferedReader in = new BufferedReader(new InputStreamReader( | ||
new ByteArrayInputStream(output.toByteArray()))); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit loses important functionality: if you commit on another named branch (say, a bug fix on BRANCH_V9), and then merge that commit to the configure branch (say, BRANCH_V10), a build will no longer be triggered now, even tough something significant did change.
Previously, the commit on BRANCH_V9 was picked up by jenkins.