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

StackOverflow https://stackoverflow.com/questions/8913184

  •  17-04-2021
  •  | 
  •  

質問

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?

役に立ちましたか?

解決

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.

他のヒント

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

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top