Skip to content

Commit

Permalink
Merge pull request #186 from jglick/registerHook
Browse files Browse the repository at this point in the history
Fixing `MercurialRule.registerHook`
  • Loading branch information
jglick authored Nov 16, 2021
2 parents 5b7d524 + 8bcdc70 commit f869141
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/test/java/hudson/plugins/mercurial/MercurialRule.java
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,9 @@ public void registerHook(FilePath repo) throws Exception {

FilePath hook = hgDir.child("hook.py");

String hook_text = IOUtils.toString(this.getClass().getResourceAsStream("hook.py"), "UTF-8");
StringUtils.replace(hook_text, "@JENKINS_URL@", j.getURL().toString());
StringUtils.replace(hook_text, "@REPO_URL@", repo.toURI().toString());
String hook_text = IOUtils.toString(MercurialRule.class.getResourceAsStream("/hook.py"), "UTF-8");
hook_text = StringUtils.replace(hook_text, "@JENKINS_URL@", j.getURL().toString());
hook_text = StringUtils.replace(hook_text, "@REPO_URL@", repo.toURI().toString());
hook.write(hook_text, null);

hgDir.child("hgrc").write(
Expand Down

0 comments on commit f869141

Please sign in to comment.