English 中文(简体)
Configure hudson to build multiple branches
原标题:

I use an ant file to build a java project in mercurial through hudson. The mailnine has a hudson job running just fine. Recently a new branch was created and pushed to the server by commnd line:


hg branch newbranch
hg commit
hg push -f


The mainine does not contain these changes and still builds fine. I have set up a new job with the same setting as mainline (in fact copied mainline job in hudson), and specified the newbranch.

However, the newbranch job builds code identical to mainline. If I commandline clone the repository and switch to the newbranch everything looks as expected. This seems to be a hudson configuration glitch unless my merqurial skills are off course.

I have also tried to set up the job from sratch with settings identical to mainline with the addition of the newbranch specification without any luck.

What am I missing? Anyone any ideas?

问题回答

Try putting the branch in the URL to clone like:

http://server/path/to/repo#newbranch

or

ssh://user@server//path/to/repo#newbranch

You can see the full syntax for branch-in-repo-url using hg help urls

URL Paths

Valid URLs are of the form:

  local/filesystem/path[#revision]
  file://local/filesystem/path[#revision]
  http://[user[:pass]@]host[:port]/[path][#revision]
  https://[user[:pass]@]host[:port]/[path][#revision]
  ssh://[user[:pass]@]host[:port]/[path][#revision]

Paths in the local filesystem can either point to Mercurial repositories
or to bundle files (as created by  hg bundle  or  hg incoming --bundle ).

An optional identifier after # indicates a particular branch, tag, or
changeset to use from the remote repository. See also  hg help revisions .

One issue with cloning a job is that the cloned job is created as soon as you hit the clone button. While you are still configuring the cloned job, it may hit a build trigger like an SCM polling event that causes it to kick off before you have fully configured it.

I believe this was fixed in later versions of Hudson, but cannot find the changelog entry for job cloning. The same issue existed for cloning a slave configuration, and the problem was fixed in Hudson 1.319.





相关问题
Can I clone part of a Mercurial repository?

Is it possible to clone part of a Mercurial repository? Let s say the repository is quite large, or contains multiple projects, or multiple branches. Can I clone only part of the repository? E.g. in ...

Sync files in Two Different Repos using HG

I ve got a problem when I try to sync files in two different repos. What I want to do is: I ve got 2 repos A and B, and they share some common files, suppose they lie in A/docs/common/ and B/docs/...

Tips on upgrading CVS to git/hg?

We still use CVS, I use git and hg for my personal use though I m still a novice at both, but I realize they re much more modern and better, faster, distributed, etc. It s just everyone is so ...

git for mercurial like git-svn

Hello is there a tool for git that allow to work with mercurial repositories F.e. for svn there is a git-svn package, that allows to clone/commit/update from svn and work in a git way.. So is there ...

Useful Mercurial Hooks [closed]

What are some useful Mercurial hooks that you have come across? A few example hooks are located in the Mercurial book: acl bugzilla notify check for whitespace I personally don t find these very ...

热门标签