2

这将是一个很长的帖子……抱歉。

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

目前看来

  • 可以递归地签入嵌套签入的代码,尽管 hg status 没有提供有关嵌套存储库中文件更改的太多信息
  • 看来我——以及每个想要从事同一个项目的团队成员——必须手动编辑他们的子存储库.hgrc文件,以使签入尽可能轻松和自动化。
  • 可以递归签入,但不支持递归签出。

这是对 Hg 能力的正确分析吗?

我真的不希望这样,因为这比我见过的普通开发团队在保持生产力的同时可以处理更多的棒式编码(即到处摆弄命令提示符)据我了解,重构单个程序集可能会使团队陷入停顿,因为他们停下来编辑.hgrc文件以添加位置、用户和密码。不?

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

谢谢!

PS:对于勇敢或愚蠢的人(如果有帮助),我在解决引用其他库模块的引用库模块的项目问题时一直保留的注释如下(注意 ??? ? QUESTIONS??? 穿插在其中...

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:pwd@bitbucket.org/xact/liba"
        # "default-push = https://user:pwd@bitbucket.org/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:pwd@bitbucket.org/xact/libb"
        # "default-push = https://user:pwd@bitbucket.org/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:pwd@bitbucket.org/xact/liba"
                # "default-push = https://user:pwd@bitbucket.org/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:pwd@bitbucket.org/xact/proja"
        # "default-push = https://user:pwd@bitbucket.org/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:pwd@bitbucket.org/xact/liba"
                # "default-push = https://user:pwd@bitbucket.org/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:pwd@bitbucket.org/xact/libb"
                # "default-push = https://user:pwd@bitbucket.org/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
4

1 回答 1

0

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

目前看来

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

简称hg status --subreposhg status -S

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

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

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

结帐,即更新,是递归的。当您hg clone获取本地存储库时,Mercurial 会注意到.hgsub.hgsubstate文件,它会递归地克隆那里引用的子存储库。

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

是的,您错过了 Mercurial 如何知道您想要哪些子存储库。请参阅wiki 上的文档或Kick Start 指南

于 2011-02-28T09:55:55.303 回答