我想保留一系列 mercurial subprepositories 更新,tip
这就是我想出的。如果我这样做,有什么我看不到的陷阱吗?
背景故事
多年来,我一直在使用单体颠覆存储库main
,但我正准备将其转换为 mercurial。我唯一不喜欢 mercurial 的是我不能只克隆一个子目录。我正在考虑将每个顶级目录main
放入自己的 mercurial 存储库中。然后我可以创建一个名为 mercurial 的 repo maincollections
,它将每个新的 mercurial repo 引用为 subrepo。为了通过在里面拉一次来更改任何子存储库,maincollections
我设置了以下内容。
方法
当在任何一个子存储库中的服务器上收到推送时,它会触发changegroup
挂钩以commit-sub
强制更新和提交存储库。.hgsubstate
maincollections
#!/bin/bash
SUBNAME=$(basename $(pwd))
cd ../../maincollection/$SUBNAME
hg pull
hg up
cd ..
hg ci -m "Automated update of .hgsubstate"
目录组织
maincollection # repo with subrepos
main/* # Individual subrepos