Mercurial自动更新问题

发布于 2024-09-02 15:51:06 字数 310 浏览 7 评论 0原文

我们开始使用 Mercurial 进行源代码控制。我们已将 HGRC 配置文件配置为在推送到“中央”存储库后自动更新。 对于某些电脑,我们会收到此错误消息:

warning: changegroup hook exited with status -1

HGRC 看起来像这样:

[ui] 
username=ADMIN
verbose=true

[hooks]
changegroup = hg update >&2

稍后我们手动执行更新,一切正常。

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 some PCs we get this error msg:

warning: changegroup hook exited with status -1

HGRC looks like this:

[ui] 
username=ADMIN
verbose=true

[hooks]
changegroup = hg update >&2

Later we perform the update manually and everything works right.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

乖乖哒 2024-09-09 15:51:06

我有一个非常相似的问题。现在终于可以工作了:

changegroup = cmd /c hg update

粗体 cmd /c 会导致 cmd.exe 生成,它将按照我们的意愿执行 hg update,但现在 cmd.exe 的退出值将为 0

。故事:

设置:win 2008 服务器。
水银1.9.3
hgwebdir 通过普通 http,它是一个内部网络

错误:
有趣的是,我的错误不是您的情况中的 -1 ,而是
“警告:changegroup 挂钩已退出,状态为 1
无论如何,更新没有执行。

我发现我可以将钩子放入 .hgrc 或 hgweb.config 中,问题在这里或那里是相同的。我最终将其放入 hgweb.config 中,如下所示,因此所有存储库都是自动提交的,这比一直拥有这个松散​​的分支要好得多。我想要自动提交的主要原因是 vcs 和 vcs 上的存储库。构建服务器现在拥有最新版本,这使得管理任务变得更加简单。

[web]
push_ssl=Falseallow_push=*

[集合]
c:\Dev\Reps = c:\Dev\Reps

[ui]
debug=true

[挂钩]
changegroup = cmd /c hg update

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

路还长,别太狂 2024-09-09 15:51:06

它可能与用户实际执行挂钩,这可能不是具有正确权限的人。

您是否有 IIS Web 服务器来管理您的 Mercurial 存储库?

(来自线程:)

根据 Mercurial/IIS 的经验,我建议尝试的事情:

  • (a) 运行简单的非 HG 命令是否有效? cmd.exe 上的权限将
    影响进程外的Python钩子。
  • (b) 像“python -c "import sys; sys.exit(0)"”这样的简单挂钩可以工作吗?
  • (c) 如果您做到了这一点,您能否确认该进程正在作为
    您认为它正在运行的用户,带有一个执行以下操作的钩子:
import win32api
username = win32api.GetUserName()
(write username to a file so you can read it)

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)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文