-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
Windows Server 2003
Push notifications do not work well with a Windows server accessing the repo as a local directory.
It looks like the issue is that, doNotifyCommit in MercurialStatus creates a URL out of the passed in Repo location string. This creates limitations that are not present when the Repository URL is passed into hg.
Additionally, the string passed into the push notification is processed as a URL when it goes through the web server, then it is processed again in the plugin. As a result, I had to double escape some characters.
Here is an example:
The URL I originally had in the settings: E:\Repo\Track App.hg
The job accesses the repo and updates the working directory properly.
If I access http://myjenkins:8080/mercurial/notifyCommit?url=E:\RepoApps\Repo\Track App.hg
I get an illegal character exception.
I can get it to accept it if I double escape the illegal characters.
http://myjenkins:8080/mercurial/notifyCommit?url=E:%255CRepoApps%255CRepo%255CTrack%2520App.hg
This doesn't work because, when looking for a relevant job, it fails on this comparison:
E:%5CRepoApps%5CRepo%5CTrack%20App.hg == E:\RepoApps\Repo\Track App.hg
It needs both the URL in the settings to be escaped in the same way as the one passed into the web API. I can't find a way to do this with a local directory.
This also may not work because it seems to process the string in the settings page as a URL as well, so this may fail with illegal characters.
The double processing of the string in the API would be OK if it then compared a fully escaped string to the string in the settings page (without trying to escape the settings string as well). I would be able to construct an API call that would make it through processing and match correctly.
I found a convoluted way to get this to work with the current design. It needs a network share instead of a local directory.
The URL in settings looks like this:
file:%5C%5CSERVER%5CRepo%5CTrack%20App.hg
And the API call:
http://myjenkins:8080/mercurial/notifyCommit?url=file:%255C%255CSERVER%255CRepo%255CTrack%2520App.hg
This work-around has one final problem. The convoluted URL in the settings does not match the one hg adds to hgrc. This causes the repo to be cloned for every build. I was able to work around this by manually updating the hgrc file in the workspace with the expected string.
After all this tweaking, it seems to work OK.