Is there a way to configure jenkins mercurial plugin to poll only tags/branches matching a specific pattern? I.e. I need it to trigger a build only if a new tag with '-dev' suffix has been pushed
Asked
Active
Viewed 297 times
1 Answers
0
Answering my own question
The field Revision in the jenkins mercurial plugin is the same value one can use in hg log -r <expression>
hence all of the expressions available here can be used
For example to find the latest -dev tag the following expression needs to be entered into the Revision field:
max(tag("re:\-dev$"))

Oleg Kuralenko
- 11,003
- 1
- 30
- 40
-
Looks like this is working in the first place, but no manual build are possible and all commits that are no new tag matching the expression are failures. After first successful build jenkins tries to verify if new commits can be skipped in polling by filtering: `$ hg ... --rev 'ancestors('max(tag("re:\-dev$"))') and not ancestors(XZY)' abort: unknown revision 'max(tag("re:\-dev$"))'! ERROR: Failed to capture change log java.io.IOException: Failure detected while running hg log to determine change log at hudson.plugins.mercurial.MercurialSCM.determineChanges(MercurialSCM.java:668)` – jan Mar 23 '18 at 10:00