如何定义窑/ mercurial子库使用哪个变更集?

uns*_*zed 2 mercurial kiln

在关于窑堆栈交换网站的这个问题的答案中,有一条评论提到"如果你从图书馆的一个消费者那里提交,其他图书馆消费者不会立即看到这些变更集.你必须明确地在其他消费者的图书馆回购."

我已经将一些文件添加到项目.hgsub和.hgsubstate文件中引用的存储库中,但是它们没有显示在项目子库中(因为项目非常正确地使用之前更改的先前更改集) )

我想知道如何编辑subrepo使用的变更集.我只是编辑.hgsubstate文件(看起来有点"hackish")或者是否有我可以使用的命令/窑网站选项?

Mar*_*nen 5

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

示例(Windows .bat文件):

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
Run Code Online (Sandbox Code Playgroud)

  • 乐于帮助.要记住的主要想法是在主回购记录中提交任何子存储库的*当前父项*,因此*你*控制何时移动到更新的subrepo内容. (2认同)