开发者

How can I build a version tagged in Mercurial with 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?


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:

% hg init test

% echo this > test/file

% hg -R test commit --addremove --message 'a commit'
adding file

% hg -R test tag mytag

% hg clone --rev mytag test test-clone

% hg -R test-clone update --rev mytag
abort: unknown revision 'mytag'!

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 tag mytag, but it doesn't bring over the subsequent changeset that actually creates a tag named mytag.

If that's the problem (and again it's just a guess) then you either need to clone over everything or hg update to tip.

If that's not the case look in your .hgtags file and verify that tag exists in it.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜