Skip to content

Commit

Permalink
Merge pull request #30 from jglick/getEffectiveBrowser-JENKINS-35098
Browse files Browse the repository at this point in the history
[JENKINS-35098] Work around core misfeature when using 1.642.x or 1.651.x
  • Loading branch information
jglick committed Oct 31, 2016
2 parents d074acb + 70ec663 commit 7ef365b
Showing 1 changed file with 8 additions and 1 deletion.
Expand Up @@ -51,6 +51,7 @@
import hudson.model.listeners.RunListener;
import hudson.model.listeners.SCMListener;
import hudson.scm.ChangeLogSet;
import hudson.scm.RepositoryBrowser;
import hudson.scm.SCM;
import hudson.scm.SCMRevisionState;
import hudson.security.ACL;
Expand Down Expand Up @@ -674,7 +675,7 @@ public synchronized List<ChangeLogSet<? extends ChangeLogSet.Entry>> getChangeSe
if (co.changelogFile != null && co.changelogFile.isFile()) {
try {
ChangeLogSet<? extends ChangeLogSet.Entry> changeLogSet =
co.scm.createChangeLogParser().parse(this, co.scm.getEffectiveBrowser(), co.changelogFile);
co.scm.createChangeLogParser().parse(this, getEffectiveBrowser(co.scm), co.changelogFile);
if (!changeLogSet.isEmptySet()) {
changeSets.add(changeLogSet);
}
Expand All @@ -687,6 +688,12 @@ public synchronized List<ChangeLogSet<? extends ChangeLogSet.Entry>> getChangeSe
return changeSets;
}

/** Replacement for {@link SCM#getEffectiveBrowser} to work around JENKINS-35098. TODO 2.7.3+ delete */
private static RepositoryBrowser<?> getEffectiveBrowser(SCM scm) {
RepositoryBrowser<?> b = scm.getBrowser();
return b != null ? b : scm.guessBrowser();
}

@RequirePOST
public synchronized HttpResponse doStop() {
Executor e = getOneOffExecutor();
Expand Down

0 comments on commit 7ef365b

Please sign in to comment.