Skip to content
Permalink
Browse files

Merge pull request #68 from mcclellansws/master

[FIXED JENKINS-27316] Remove excessive stack traces in log
  • Loading branch information...
jglick committed Aug 3, 2015
2 parents 88c2c0c + dc23cfe commit e21525c917a7b1cc2152299b423b417ec7a9fd2e
@@ -54,13 +54,19 @@ public String getUrlName() {
return "mercurial";
}

static private boolean isUnexpandedEnvVar(String str) {
return str.startsWith("$");
}

static boolean looselyMatches(URI notifyUri, String repository) {
boolean result = false;
try {
URI repositoryUri = new URI(repository);
result = Objects.equal(notifyUri.getHost(), repositoryUri.getHost())
&& Objects.equal(notifyUri.getPath(), repositoryUri.getPath())
&& Objects.equal(notifyUri.getQuery(), repositoryUri.getQuery());
if (!isUnexpandedEnvVar(repository)) {
URI repositoryUri = new URI(repository);
result = Objects.equal(notifyUri.getHost(), repositoryUri.getHost())
&& Objects.equal(notifyUri.getPath(), repositoryUri.getPath())
&& Objects.equal(notifyUri.getQuery(), repositoryUri.getQuery());
}
} catch ( URISyntaxException ex ) {
LOGGER.log(Level.SEVERE, "could not parse repository uri " + repository, ex);
}
@@ -72,6 +72,9 @@
assertTrue( MercurialStatus.looselyMatches(new URI("http://somehost/path"), "ssh://somehost/path") );
assertTrue( MercurialStatus.looselyMatches(new URI("https://somehost/path"), "http://somehost/path") );
assertTrue( MercurialStatus.looselyMatches(new URI("ssh://somehost/path"), "https://somehost/path") );

assertFalse( MercurialStatus.looselyMatches(new URI("http://scm.foocompany.com/hg/foocomponent/"), "${REPO_URL}") );
assertFalse( MercurialStatus.looselyMatches(new URI("http://scm.foocompany.com/hg/foocomponent/"), "$REPO_URL") );
}

}

0 comments on commit e21525c

Please sign in to comment.
You can’t perform that action at this time.