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