From c0c4bd98dd8f3e1aab161f3ecb562b0b96f4a520 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Thu, 18 Jul 2013 10:14:31 -0400 Subject: [PATCH] [FIXED JENKINS-18807] Ignore SCM triggers which ask to suppress post-commit hooks. Requires 1.493+, so just update to 1.509.x already. --- pom.xml | 2 +- src/main/java/hudson/plugins/mercurial/MercurialStatus.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 57704687..ba755b76 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.jenkins-ci.plugins plugin - 1.480.3 + 1.509.2 mercurial diff --git a/src/main/java/hudson/plugins/mercurial/MercurialStatus.java b/src/main/java/hudson/plugins/mercurial/MercurialStatus.java index 6bc08b4a..6d99ac21 100644 --- a/src/main/java/hudson/plugins/mercurial/MercurialStatus.java +++ b/src/main/java/hudson/plugins/mercurial/MercurialStatus.java @@ -120,7 +120,7 @@ private HttpResponse handleNotifyCommit(URI url) throws ServletException, IOExce LOGGER.log(Level.INFO, "url == " + url + " repository == " + repository); if (looselyMatches(url, repository)) urlFound = true; else continue; SCMTrigger trigger = project.getTrigger(SCMTrigger.class); - if (trigger!=null) triggerFound = true; else continue; + if (trigger!=null && !trigger.isIgnorePostCommitHooks()) triggerFound = true; else continue; LOGGER.log(Level.INFO, "Triggering the polling of {0}", project.getFullDisplayName()); trigger.run(); @@ -130,7 +130,7 @@ private HttpResponse handleNotifyCommit(URI url) throws ServletException, IOExce final String msg; if (!scmFound) msg = "No mercurial jobs found"; else if (!urlFound) msg = "No mercurial jobs using repository: " + url; - else if (!triggerFound) msg = "Jobs found but they aren't configured for polling"; + else if (!triggerFound) msg = "Jobs found but they are not configured for polling or are ignoring post-commit hooks"; else msg = null; return new HttpResponse() {