简体   繁体   中英

How to export (hg archive) a named branch in mercurial?

I am setting up continuous integration (Jenkins) with Mercurial and am trying to configure it to build multiple releases (branches). I have it working for the default branch using hg archive to export (svn term) the code to perform a clean build. Now I'd like to do the same for a named branch.

My problem is, I can't figure out how to specify the named branch for hg archive. There is an option to specify a tag (or revision) with the -r option, but I don't see anything about branches.

As perhaps a related issue, it seems that when I do an hg archive , it exports from the working directory rather than the repository. This means when someone commits code, we have to do hg update first before hg archive to get the code into the build. Perhaps I can configure Jenkins to do this automatically?

As is probably apparent, I am coming from an svn background and am not sure that I have my head completely wrapped around Mercurial, so let me know the better way if I am approaching this the wrong way.

The --rev argument will accept a named branch. For example, you may do something like:

hg archive --rev <branch_name> <DESTINATION>

This gives you an archive of the repo at the tip of the named branch.

See hg help revisions for details.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM