Skip to content

Latest commit

 

History

History
57 lines (31 loc) · 1.1 KB

2015-01-16-hg-remote-push-hook.md

File metadata and controls

57 lines (31 loc) · 1.1 KB
layout date title tag
post
2015-01-16 01:43:47 +0800
使用hg推送后执行编译
hg

hg hook

大多数的版本管理工具都具有钩子功能,这里记录下开发团队内部工具sluggard时,遇到的关于hg hook的使用。

在被推送端, .hg/hgrc下配置

[ui]
username = hg_be_pushed
verbose = True

[hooks]
commit = /path/to/commithook
incoming = /path/to/incominghook    # 每个 commit 执行一次
changegroup= /path/to/changegroup   # 每次被 push 执行一次

[web]
push_ssl = No    # 放开ssl限制
allow_push = *   # 运行推送

需要说明的是,被push端需要开启web服务,才能接收push

hg serve -p port

推送端,.hg/hgrc配置如下

[ui]
username = hg_to_push

[paths]
default = http://localhost:8002/       # 用于pulling
default-push = http://localhost:8002/  # 被推送端的 web 服务地址

当推送遇到错误时,可尝试

hg push -f

当更新遇到错误时,可尝试

hg update --check