是否可以将Mercurial子仓库钉到特定版本(例如svn:externals)? [英] Is it possible to peg a Mercurial subrepo to a specific revision (like svn:externals)?

查看:112
本文介绍了是否可以将Mercurial子仓库钉到特定版本(例如svn:externals)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将一组项目从Subversion迁移到Mercurial.这些项目当前使用svn:externals将代码从一个代码拉入另一个代码.我一直遵循建议,将外部设备指向特定的修订版本号,并根据需要进行手动更新(这样,当我更新到主项目的先前版本时,我也可以获得外部版本的过去版本.)

I'm migrating a set of projects from Subversion to Mercurial. The projects currently use svn:externals to pull code from one into the others. I've been following the recommendation to point externals to a specific revision number and manually update it as needed (so that when I update to a past revision of the main project, I get the past version of the externals too).

在Mercurial中进行外部处理的方法似乎是使用subrepos,但是我没有看到将它们固定到特定版本的方法-好像每当我更新主版本时,Hg都会始终将subrepos更新到最新版本.回购.那是对的吗?并有一种解决方法吗?

The way to do externals in Mercurial seems to be with subrepos, but I don't see a way to peg them to a specific revision - it looks like Hg will always update the subrepos to the latest revision whenever I update the main repo. Is that correct? And is there a way to work around it?

推荐答案

(摘自我上面的评论)

结果证明我错了.它不会更新到最新修订版,而是更新到.hgsubstate文件中指定的修订版,该文件受版本控制,并在每次提交时自动更新.因此,实际上,此版本比SVN外部版本更容易,因为无需手动重新挂钩修订版本.主存储库的每个修订版都会自动与子存储库的相应修订版关联.

Turns out I was wrong. It doesn't update to the latest revision, it updates to the revision specified in the .hgsubstate file, which is version controlled and automatically updated at each commit. So this is actually easier than SVN externals since the revision doesn't have to be manually re-pegged; each revision of the main repo is automatically associated with the corresponding revisions of the subrepos.

这篇关于是否可以将Mercurial子仓库钉到特定版本(例如svn:externals)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆