Mercurial auto update problem

后端 未结 2 1997
粉色の甜心
粉色の甜心 2021-01-15 06:34

We are starting to use Mercurial for source control. We have configured the HGRC configuration file to do an auto update after we push to the \"central\" repository. With so

相关标签:
2条回答
  • 2021-01-15 06:43

    I had a very simmilar issue. This finally works now:

    changegroup = cmd /c hg update

    The bold cmd /c causes cmd.exe to spawn which will execute hg update as we want it to, but now the exit value from cmd.exe will be 0.

    Longer Story:

    setup: win 2008 server.
    mercurial 1.9.3
    hgwebdir via plain http, its an internal network

    error: my error was funnily not the -1 as in your case but
    "warning: changegroup hook exited with status 1"
    Anyway, the update was not performed.

    I found out that I can put the hooks into either .hgrc or into hgweb.config the problem was the same here or there. I finally put it into hgweb.config as below, so all repositories are auto commiting, which is way better than having this loose branch all the time. The main reason I wanted auto commit is that the respositories on the vcs & build server hold now the latest version which makes admin tasks often simpler.

    [web]
    push_ssl = False allow_push = *

    [collections]
    c:\Dev\Reps = c:\Dev\Reps

    [ui]
    debug=true

    [hooks]
    changegroup = cmd /c hg update

    0 讨论(0)
  • 2021-01-15 06:53

    It might be related with the user actually executing the hook, which might not be the one with the correct privileges.

    Do you have a IIS webserver managing your Mercurial repos?

    (from the thread:)

    From experience with Mercurial/IIS, things I'd recommend trying:

    • (a) Does running a simple non-HG command work? Permissions on cmd.exe will affect out-of-process python hooks.
    • (b) Does a simple hook like 'python -c "import sys; sys.exit(0)"' work?
    • (c) If you make it this far, can you confirm that the process is running as the user you think it's running as, with a hook that does something like:
    import win32api
    username = win32api.GetUserName()
    (write username to a file so you can read it)
    
    0 讨论(0)
提交回复
热议问题