首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >您如何定义kiln/mercurial子存储库使用哪个变更集?

您如何定义kiln/mercurial子存储库使用哪个变更集?
EN

Stack Overflow用户
提问于 2012-01-16 10:13:40
回答 1查看 377关注 0票数 2

在kiln exchange站点上对this question的回答中,有一条评论提到“如果你从库的一个消费者提交,其他库消费者不会立即看到这些变更集。你必须显式地将库repo上的更改拉到其他消费者中。”

我已经向项目.hgsub & .hgsubstate文件中引用的存储库添加了一些文件,但它们没有显示在projects子存储库中(因为项目正确地使用了之前分配的更改集)。

我想知道如何编辑子存储库使用的变更集。我只是编辑.hgsubstate文件(看起来有点"hackish"),还是有一个我可以使用的命令/ kiln网站选项?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-01-16 10:22:48

在子资料库中,hg update指向您希望主资料库使用的变更集。然后,在主存储库中,发出hg ci提交子存储库更改。Mercurial将用子存储库的当前父变更集ID自动更新.hgsubstate文件。

示例(Windows .bat文件):

代码语言:javascript
复制
REM Create main repository
hg init Example
cd Example
echo >file1
hg ci -Am file1
cd ..

REM Create another repository
hg init Library
cd Library
echo >file2
hg ci -Am file2
cd ..

REM Clone the Library into the main repository
cd Example
hg clone ..\Library

REM and configure it as a subrepository.
echo Library=Library >.hgsub

REM Commit it.
hg ci -Am "Added Library sub repository."

REM Note .hgsubstate is updated with the current subrepo changeset.
type .hgsubstate
cd ..

REM Someone updates the original Library.
cd Library
echo >file3
hg ci -Am file3
cd ..

REM Main repo isn't affected.  It has a clone of Library.
cd Example
hg status -S

REM Update to the latest library
cd Library
hg pull -u
cd ..

REM View the changes to the library in the main repo.
hg status -S

REM Commit the library update in the main repo.
hg ci -m "Updated library."

REM Note .hgsubstate is updated.
type .hgsubstate
票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/8875127

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档