你如何定义窑/水银子库使用的变更集

  • 本文关键字:何定义 定义 mercurial kiln
  • 更新时间 :
  • 英文 :


在窑堆栈交换网站上回答这个问题时,有一条评论提到"如果你从库的一个使用者提交,其他库使用者不会立即看到这些变更集。你必须在其他使用者的库repo上显式拉取更改。"

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

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

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

示例(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

最新更新