关于 Mercurial Security +子存储库的递归签入
这将是一篇很长的文章……抱歉。
我正在尝试思考如何将“每个项目分支的存储库”组合在一起,以及这会对团队产生什么影响。
现在看来
- 可以递归地签入代码 嵌套签入,尽管 hg 状态 没有提供太多文件信息 的更改
- 嵌套存储库内 看来我——以及每个团队 想要从事同一工作的成员 项目——必须手动编辑它们 子存储库的
.hgrc
文件按顺序排列 使办理登机手续变得轻松并且 尽可能自动化。 - 能 递归签入,但递归地 不支持结帐。
这是对 Hg 能力的正确分析吗?
我真的希望不会,因为这比我见过的平均开发团队在保持生产力的同时要处理更多的变速杆编码(即命令提示符到处摆弄)。据我了解,重构单个程序集可能会让团队陷入停顿,因为他们停止编辑 .hgrc
文件以添加位置、用户和密码。不?
我真的想仔细检查一下 Hg 是否不能递归拉?听起来像是一个遗漏,我觉得我一定错过了什么。
谢谢!
附: 对于勇敢或愚蠢的人(如果有帮助的话),当我解决引用其他库模块的库模块的项目问题时,我一直保留的注释如下(注意 ???? 问题??? 穿插在其中……
MERCURIAL
# requires an .hgsub with a ref to either
# an Hg Repo for only one Bin...?
# a website download...is that possible?
# an svn repo that allow referencing just one folder in it
# eg: "BIN/A3rdParty = svn:^/BinCache/A3rdParty/bin"
LibA\
hg\
.hgrc
# ??? QUESTION ???
# does each user have to edit their own files by hand
# to allow automatic push/pull?
# "default = https://user:[email protected]/xact/liba"
# "default-push = https://user:[email protected]/xact/liba"
.hgsub
# Map of nested repos as follows:
# "BIN/A3rdParty = svn:^/BinCache/A3rdParty/bin"
# "EXT/LibA = https://bitbucket.org/xact/liba"
# "EXT/LibB = https://bitbucket.org/xact/libb"
LibA.sln
BIN\
[A3rdParty\SomeLib.dll]
EXT\
SRC\
LibA\LibA.csproj
# ...which References "..\..\BIN\A3rdParty\SomeLib.dll"
LibA.Tests\LibA.Tests.csproj
# ...which References "..\LibA\LibA.csproj"
LibB\
hg\
.hgrc
# ??? QUESTION ???
# does each user have to edit their own files by hand
# to allow automatic push/pull?
# "default = https://user:[email protected]/xact/libb"
# "default-push = https://user:[email protected]/xact/libb"
.hgsub
# that contains:
# "BIN/A3rdParty = svn:^/BinCache/A3rdParty/bin"
# "EXT/LibA = https://bitbucket.org/xact/liba"
# ??? QUESTION ???
# do end users add user/pwd info here? or in the
# nested repos .hgrc file?
LibB.sln
BIN\
[A3rdParty\SomeLib.dll]
EXT\
LibA\
hg\
.hgrc
# ??? QUESTION ???
# does each user have to edit their own files by hand
# to allow automatic push/pull?
# "default = https://user:[email protected]/xact/liba"
# "default-push = https://user:[email protected]/xact/liba"
LibA.csproj
# ...which References "..\..\BIN\A3rdParty\SomeLib.dll"
LibA.Tests\LibA.Tests.csproj
# ...which References "..\LibA\LibA.csproj"
SRC\
LibB\LibB.csproj
# ...which References "..\..\EXT\LibA\LibA.csproj"
LibB.Tests\LibB.Tests.csproj
# ...which References "..\LibB\LibB.csproj"
ProjA\
hg\
.hgrc
# ??? QUESTION ???
# does each user have to edit their own files by hand
# to allow automatic push/pull?
# "default = https://user:[email protected]/xact/proja"
# "default-push = https://user:[email protected]/xact/proja"
.hgsub
# that contains:
# "BIN/A3rdParty = svn:^/BinCache/A3rdParty/bin"
# "EXT/LibA = https://bitbucket.org/xact/liba"
# "EXT/LibB = https://bitbucket.org/xact/libb"
# ??? QUESTION ???
# do end users add user/pwd info here? or in the
# nested repos .hgrc file?
BIN\
[A3rdParty\SomeLib.dll]
EXT\
LibA\
hg\
.hgrc
# ??? QUESTION ???
# does each user have to edit their own files by hand
# to allow automatic push/pull?
# "default = https://user:[email protected]/xact/liba"
# "default-push = https://user:[email protected]/xact/liba"
LibA.csproj
# ...which References "..\..\BIN\A3rdParty\SomeLib.dll"
LibA.Tests\LibA.Tests.csproj
# ...which References "..\LibA\LibA.csproj"
LibB\
hg\
.hgrc
# ??? QUESTION ???
# does each user have to edit their own files by hand
# to allow automatic push/pull?
# "default = https://user:[email protected]/xact/libb"
# "default-push = https://user:[email protected]/xact/libb"
LibB\LibB.csproj
# ...which References "..\..\EXT\LibA\LibA.csproj"
# Important: note that it is same path offset
# as when within context of LibB.sln
LibB.Tests\LibB.Tests.csproj
# ...which References "..\LibB\LibB.csproj"
SRC\
ProjA\ProjA.csproj
ProjA.Tests\ProjA.Tests.csproj
this is going to be a long post...sorry upfront.
I'm trying to wrap my head around how to hold together "Repositories for each project branch", and what the impact of that would be on a team.
Right now, it appears that
- Can recursively checkin code of
nested checkins although hg status
doesn't give much info on file
changes within nested repos - It
appears that I -- and every team
member who wants to work on the same
project -- has to hand edit their
subrepositoies'.hgrc
files in order
to make the checkin as painless and
automated as possible. - Can
recursively checkin, but recursively
checkout is not supported.
Is that a correct analysis of Hg's capabilities?
I'm really hoping not, as that's a lot more stick-shift coding (ie command prompt fiddling all over the place), than the average dev team I've seen could handle, while remaining productive. As I've understood it, refactoring a single assembly would probably grind the team to a halt as they stop to edit the .hgrc
files to add location, user and password. No?
And I really want to double check that Hg can't recursively pull? Sounds like such an omission, that I feel I must have missed something.
Thanks!
PS:
For the brave or foolish, (and in case it helps), the notes I've been keeping as I work around the problem of projects that reference library modules that reference other library modules, is as follows (note the ???? QUESTIONS??? interspersed in them...
MERCURIAL
# requires an .hgsub with a ref to either
# an Hg Repo for only one Bin...?
# a website download...is that possible?
# an svn repo that allow referencing just one folder in it
# eg: "BIN/A3rdParty = svn:^/BinCache/A3rdParty/bin"
LibA\
hg\
.hgrc
# ??? QUESTION ???
# does each user have to edit their own files by hand
# to allow automatic push/pull?
# "default = https://user:[email protected]/xact/liba"
# "default-push = https://user:[email protected]/xact/liba"
.hgsub
# Map of nested repos as follows:
# "BIN/A3rdParty = svn:^/BinCache/A3rdParty/bin"
# "EXT/LibA = https://bitbucket.org/xact/liba"
# "EXT/LibB = https://bitbucket.org/xact/libb"
LibA.sln
BIN\
[A3rdParty\SomeLib.dll]
EXT\
SRC\
LibA\LibA.csproj
# ...which References "..\..\BIN\A3rdParty\SomeLib.dll"
LibA.Tests\LibA.Tests.csproj
# ...which References "..\LibA\LibA.csproj"
LibB\
hg\
.hgrc
# ??? QUESTION ???
# does each user have to edit their own files by hand
# to allow automatic push/pull?
# "default = https://user:[email protected]/xact/libb"
# "default-push = https://user:[email protected]/xact/libb"
.hgsub
# that contains:
# "BIN/A3rdParty = svn:^/BinCache/A3rdParty/bin"
# "EXT/LibA = https://bitbucket.org/xact/liba"
# ??? QUESTION ???
# do end users add user/pwd info here? or in the
# nested repos .hgrc file?
LibB.sln
BIN\
[A3rdParty\SomeLib.dll]
EXT\
LibA\
hg\
.hgrc
# ??? QUESTION ???
# does each user have to edit their own files by hand
# to allow automatic push/pull?
# "default = https://user:[email protected]/xact/liba"
# "default-push = https://user:[email protected]/xact/liba"
LibA.csproj
# ...which References "..\..\BIN\A3rdParty\SomeLib.dll"
LibA.Tests\LibA.Tests.csproj
# ...which References "..\LibA\LibA.csproj"
SRC\
LibB\LibB.csproj
# ...which References "..\..\EXT\LibA\LibA.csproj"
LibB.Tests\LibB.Tests.csproj
# ...which References "..\LibB\LibB.csproj"
ProjA\
hg\
.hgrc
# ??? QUESTION ???
# does each user have to edit their own files by hand
# to allow automatic push/pull?
# "default = https://user:[email protected]/xact/proja"
# "default-push = https://user:[email protected]/xact/proja"
.hgsub
# that contains:
# "BIN/A3rdParty = svn:^/BinCache/A3rdParty/bin"
# "EXT/LibA = https://bitbucket.org/xact/liba"
# "EXT/LibB = https://bitbucket.org/xact/libb"
# ??? QUESTION ???
# do end users add user/pwd info here? or in the
# nested repos .hgrc file?
BIN\
[A3rdParty\SomeLib.dll]
EXT\
LibA\
hg\
.hgrc
# ??? QUESTION ???
# does each user have to edit their own files by hand
# to allow automatic push/pull?
# "default = https://user:[email protected]/xact/liba"
# "default-push = https://user:[email protected]/xact/liba"
LibA.csproj
# ...which References "..\..\BIN\A3rdParty\SomeLib.dll"
LibA.Tests\LibA.Tests.csproj
# ...which References "..\LibA\LibA.csproj"
LibB\
hg\
.hgrc
# ??? QUESTION ???
# does each user have to edit their own files by hand
# to allow automatic push/pull?
# "default = https://user:[email protected]/xact/libb"
# "default-push = https://user:[email protected]/xact/libb"
LibB\LibB.csproj
# ...which References "..\..\EXT\LibA\LibA.csproj"
# Important: note that it is same path offset
# as when within context of LibB.sln
LibB.Tests\LibB.Tests.csproj
# ...which References "..\LibB\LibB.csproj"
SRC\
ProjA\ProjA.csproj
ProjA.Tests\ProjA.Tests.csproj
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我会尽力回答您的一些问题,但我真的认为您应该与我们讨论这个问题,而不是在这里进行问答。
请参阅
hg status --subrepos
或hg status -S< /code> 简称。
无需将用户名和密码放入
.hg/hgrc
文件中 - 您应该配置 在 Mercurial 中缓存 HTTP 凭据。签出,即更新,是递归的。当您执行
hg clone
来获取本地存储库时,Mercurial会注意到.hgsub
和.hgsubstate
文件,并且它将递归地克隆子存储库那里引用了。是的,您错过了 Mercurial 如何知道您想要哪些子存储库。请参阅wiki 上的文档或Kick Start 指南。
I will try to answer some of your questions though I really think you should discuss this with us instead of doing a Q&A here.
See
hg status --subrepos
orhg status -S
for short.No need to put usernamed and passwords into the
.hg/hgrc
files -- you should instead configure caching of HTTP credentials in Mercurial.Checkout, i.e., update, is recursive. When you do
hg clone
to get a local repository, then Mercurial will notice the.hgsub
and.hgsubstate
files and it will recursively clone the subrepositories referenced there.Yes, you're missing how Mercurial knows which subrepositories you want. Please see the documentation on the wiki or the Kick Start guide.