关于 Mercurial Security +子存储库的递归签入

发布于 2024-10-19 11:52:53 字数 6364 浏览 1 评论 0原文

这将是一篇很长的文章……抱歉。

我正在尝试思考如何将“每个项目分支的存储库”组合在一起,以及这会对团队产生什么影响。

现在看来

  • 可以递归地签入代码 嵌套签入,尽管 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

软糯酥胸 2024-10-26 11:52:53

我会尽力回答您的一些问题,但我真的认为您应该与我们讨论这个问题,而不是在这里进行问答。

现在看来

  • 可以递归地签入嵌套签入的代码,尽管 hg status 没有提供有关嵌套存储库中文件更改的太多信息

请参阅 hg status --subreposhg status -S< /code> 简称。

  • 看来我以及每个想要从事同一项目的团队成员都必须手动编辑其子存储库的 .hgrc 文件,以便使签入变得轻松且自动化尽可能。

无需将用户名和密码放入 .hg/hgrc 文件中 - 您应该配置 在 Mercurial 中缓存 HTTP 凭据

  • 可以递归签入,但不支持递归签出。

签出,即更新,是递归的。当您执行hg clone来获取本地存储库时,Mercurial会注意到.hgsub.hgsubstate文件,并且它将递归地克隆子存储库那里引用了。

我真的想仔细检查一下 Hg 是否不能递归拉?听起来像是一个遗漏,我觉得我一定错过了一些东西。

是的,您错过了 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.

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

See hg status --subrepos or hg status -S for short.

  • 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.

No need to put usernamed and passwords into the .hg/hgrc files -- you should instead configure caching of HTTP credentials in Mercurial.

  • Can recursively checkin, but recursively checkout is not supported.

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.

And I really want to double check that Hg can't recursively pull? Sounds like such an ommission, that I feel I must have missed something.

Yes, you're missing how Mercurial knows which subrepositories you want. Please see the documentation on the wiki or the Kick Start guide.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文