如何在 Mercurial 中导出(hg 存档)命名分支?
我正在设置与 Mercurial 的持续集成(Jenkins),并尝试将其配置为构建多个版本(分支)。我让它在默认分支上工作,使用 hg archive 导出(svn 术语)代码以执行干净的构建。现在我想对一个命名分支做同样的事情。
我的问题是,我不知道如何为 hg archive 指定命名分支。有一个选项可以使用 -r 选项指定标签(或修订版),但我没有看到任何有关分支的信息。
也许是一个相关的问题,似乎当我执行 hg archive
时,它从工作目录而不是存储库导出。这意味着当有人提交代码时,我们必须在 hg archive
之前先执行 hg update
才能将代码放入构建中。也许我可以配置 Jenkins 自动执行此操作?
很明显,我来自 svn 背景,并且不确定我是否完全专注于 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
--rev
参数将接受命名分支。例如,您可以执行以下操作:这会在指定分支的顶端为您提供存储库的存档。
有关详细信息,请参阅
hg 帮助修订版
。The
--rev
argument will accept a named branch. For example, you may do something like:This gives you an archive of the repo at the tip of the named branch.
See
hg help revisions
for details.