如何使用 Hudson 构建在 Mercurial 中标记的版本?
我正在使用 Hudson 从 Mercurial 存储库构建我的项目。有两项工作:一项构建提示,另一项应构建最新版本。当我标记一个版本,然后在“分支”字段中使用该标记时,我收到此错误:
[workspace] $ hg update --clean --rev Release_1_2_beta1
abort: unknown revision 'Release_1_2_beta1'!
当我在本地副本中运行相同的命令时,它可以工作。当我克隆它在 Hudson 上崩溃的原因可能是什么?
I'm using Hudson to build my project from my Mercurial repository. There are two jobs: One builds the tip, the other should build the latest release. When I tag a release and then use that tag in the field "branch", I get this error:
[workspace] $ hg update --clean --rev Release_1_2_beta1
abort: unknown revision 'Release_1_2_beta1'!
When I run the same command in my local copy, it works. It also works when I clone the What could be the reason that it breaks on Hudson?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你所做的一切本质上都不是错误的,但我根据 Mercurial 标签的跟踪方式进行了猜测。您是否也可以使用
--rev
克隆到该工作区?这种命令模式不起作用:
不起作用的原因是
clone --rev
带来了所有变更集,包括标记mytag< 所指向的变更集。 /code>,但它不会带来实际创建名为
mytag
的标记的后续变更集。如果这就是问题所在(同样这只是猜测),那么您要么需要克隆所有内容,要么需要
hg update
到tip
。如果情况并非如此,请查看您的
.hgtags
文件并验证该标签是否存在于其中。Nothing you're doing is inherently wrong, but I have a guess based on how mercurial tags are tracked. Is it possible that you're cloning into that workspace using
--rev
too?This pattern of commands doesn't work:
The reason that doesn't work is the
clone --rev
brings over all the changesets up to and including the one pointed to by the tagmytag
, but it doesn't bring over the subsequent changeset that actually creates a tag namedmytag
.If that's the problem (and again it's just a guess) then you either need to clone over everything or
hg update
totip
.If that's not the case look in your
.hgtags
file and verify that tag exists in it.直到今天,Jenkins (Hudson) 的 Mercurial 插件还不支持 标签。
对我有用的一种方法是在作业中配置“默认”分支,并将“windows 命令”或“shell 脚本”配置为执行的第一个构建步骤:
hg update -r TAGNAME
Up until today the Mercurial plugin of Jenkins (Hudson) does not support tags.
One approach which work for me is configuring the 'default' Branch in the job and configure a 'windows command' or 'shell script' as first build step which executes:
hg update -r TAGNAME