Question

I've got Mercurial running on IIS7 fine. One thing that is frustrating is that allow_push will only take a list of usernames rather than a group.

To that end, I was wondering if it'd be possible to use a hook to carry out this task. i.e. by passing in the authenticated username, you could check on demand whether the user has the appropriate access. That's all fine if you can pass the username into the hook, for example:

[hooks]
prechangegroup = echo %username%

Unsurprisingly, this always returns the account that IIS is running on. Is there a way to either get allow_push to respect groups - or to pass the logged on user into the prechangegroup hook?

Alternative approaches welcome.

Was it helpful?

Solution

This isn't ideal - and I'd rather do as above. The alternative approach I've taken is to have an external process set the permissions on the folders in IIS for read and execute, allow_pull and allow_push in the hgrc for the repository as appropriate.

In terms of shortcomings:

  • Its another process that needs to know about the location of the repository.
  • The process needs a mechanism to find out about updates to the groups (i.e. polling).
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top