I took the fchateaus approach above (thanks man!) And modified it to work with Mercurial.
You will need to edit the .hg / hgrc file on the central server and put the changegroup switch in it. Keep in mind that change groups only set the first set of changes to the HG_NODE environment variable, so you need to do an hg tip to grab the real node advice and pass it via the URL instead. A little trick in a single line liner, but I figured it out.
This is what you would do for Windows-based Hudson.
[hooks] # this uses wget to hit the hudson url responsible for starting a build - %HG_NODE% only gets first changeset of changegroup, so use hg tip to grab changeset most recently added instead changegroup.hudson = for /f "tokens=*" %G IN ('hg tip --template {node}') DO "C:\Program Files (x86)\UnxUtils\usr\local\wbin\wget" --non-verbose --spider http://HudsonServer:8080/job/{Repository}/buildWithParameters?HgRevId=%G | ECHO Result of Hudson Polling Request For Node %G # TODO: when Hudson implements polling with parameters, change to something like this #changegroup.hudson = for /f "tokens=*" %G IN ('hg tip --template {node}') DO "C:\Program Files (x86)\UnxUtils\usr\local\wbin\wget" --non-verbose --spider http://HudsonServer:8080/job/{Repository}/polling?HgRevId=%G | ECHO Result of Hudson Polling Request For Node %G
Ethan J. Brown
source share