Is it possible to specify Windows shell to use when specifying hooks in Mercurial?

339 views Asked by At

I am trying to set up a hook on a remote repository (using hgweb) on a Windows IIS server. The issue I have is that the repository is specified as a UNC path in hgweb's config, and the hook executes cmd.exe using a UNC path which cmd.exe does not support.

Is it possible to specify a different shell to run instead?

2

There are 2 answers

4
cdeszaq On BEST ANSWER

As far as I know, you can't tell Mercurial to use a different shell on Windows (but I think you can on a Linux host)

Instead, you could have your hook script call out to a different shell and have that shell execute another script or set of commands. It's messy, but unfortunately Windows isn't know for having great scripting support, especially when compared to *nix-based platforms.

4
jk. On

Mercurial hooks can be defined two ways,

  1. as a shell hook (external hook)
  2. as a python hook (in process hook)

if you change it to be a python hook, then you would obviously have the full power of python available to do stuff. Of course there is no reason why you can't write a program in any language and execute it from your external hook as cdeszaq suggests