mercurial-server pretxncommit hook无法正常工作

时间:2014-01-16 06:33:08

标签: mercurial-hook mercurial-server

服务器

$ hg --version
    Mercurial Distributed SCM (version 2.0.2)

/usr/share/mercurial-server$ cat mercurial_server-1.1.egg-info
    Metadata-Version: 1.1
    Name: mercurial-server
    Version: 1.1

$ cat /etc/mercurial-server/remote-hgrc.d/check.rc 
    [ui]
    debug = true

    [hooks]
    commit.h1 = echo "executing commit USER:$REMOTE_USER"
    precommit.h2 = echo "executing precommit USER:$REMOTE_USER"
    pretxncommit.h3 = echo "executing pretxncommit USER:$REMOTE_USER"
    pretxnchangegroup.h4 = echo "executing pretxnchangegroup USER:$REMOTE_USER"

本地机器

unity@unity:~/hgtst/hgadmin$ vi keys/users/user.m/user.m.pub 
unity@unity:~/hgtst/hgadmin$ hg commit -m "Test L"
unity@unity:~/hgtst/hgadmin$ hg push
    pushing to ssh://hg@repo/hgadmin
    searching for changes
    remote: adding changesets
    remote: changesets: 1 chunks
    remote: add changeset 9cb298911d0c
    remote: adding manifests
    remote: manifests: 1/1 chunks (100.00%)
    remote: adding file changes
    remote: adding keys/users/user.m/user.m.pub revisions
    remote: files: 1/1 chunks (100.00%)
    remote: added 1 changesets with 1 changes to 1 files
    remote: calling hook pretxnchangegroup.access: mercurialserver.access.hook
    remote: running hook pretxnchangegroup.h4: echo "executing pretxnchangegroup USER:$REMOTE_USER"
    remote: executing pretxnchangegroup USER:
    remote: updating the branch cache
    remote: calling hook changegroup.aaaaa_servelog: mercurialserver.servelog.hook
    remote: running hook changegroup.aaaab_update: hg update -C default > /dev/null
    remote: running hook changegroup.aaaac_purge: hg purge --all > /dev/null
    remote: calling hook changegroup.refreshauth: mercurialserver.refreshauth.hook
unity@unity:~/hgtst/hgadmin$ 

当我通过ssh从本地机器向mercurial-server推送一些更改时,执行挂钩但没有执行其他挂钩。

1 个答案:

答案 0 :(得分:2)

这是可以预料的。 您不在远程服务器上提交,而是将更改推送到远程服务器。 这就是你正在使用的changegroup

对我而言,似乎所有事情都应该如此运作。

希望这有帮助,TW