将某些数据发送到文本文件的Mercurial更新挂钩
我想这真的是两个问题:将某些数据发送到文本文件的Mercurial更新挂钩,mercurial,mercurial-hook,Mercurial,Mercurial Hook,我想这真的是两个问题: 如何获取更新挂钩以执行以下操作: hg heads--template'version{tags}\tbuild{rev}.{node | short}\t于{date | shortdate}提交 简单地说:update=在hgrc文件的[hooks]部分,似乎不起作用 如何将上述输出重定向到文本文件?添加>log.txt或|log.txt根本不起作用 我确信这是非常基础的,我的命令行知识也是非常基础的——我今天早上刚刚学习了上面所有的命令 顺便说一句,如果有帮助的话,
hg heads--template'version{tags}\tbuild{rev}.{node | short}\t于{date | shortdate}提交
简单地说:update=
在hgrc文件的[hooks]
部分,似乎不起作用
>log.txt
或|log.txt
根本不起作用hg命令,但可以在shell脚本中编写yjis命令,该脚本在hook中调用。差不多
[hooks]
update = updatehook
使用路径中的updatehook.sh
|updatehook.bat
(或脚本的完整路径),其中您将
hg heads --template "version {tags}\tbuild {rev}.{node|short}\tcommitted on {date|shortdate}\n" > SOMEPATH/log.txt
(注意:在模板末尾添加了\n
——对于多头存储库,需要它)
太棒了,非常感谢你!我确实读过关于将钩子实现为外部程序的文章,但显然不理解它的含义。我知道,我很慢。但你的解释很清楚,我现在明白了。再次感谢。
>hg heads --template "version {tags}\tbuild {rev}.{node|short}\tcommitted on {date|shortdate}\n"
version default/2.0 tip build 4638.4a48cef94e2e committed on 2014-12-24
version default/master build 4620.de0053588acf committed on 2014-12-23
version default/1.6 build 2344.fc32e948fcba committed on 2013-01-06