【问题标题】:Regarding Mercurial Security + recursive checkins of subrepositories关于 Mercurial Security + 子存储库的递归签入
【发布时间】:2011-02-28 00:28:22
【问题描述】:

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

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

现在看来

  • 可以递归签入代码 嵌套签入虽然 hg 状态 没有提供太多关于文件的信息 嵌套存储库中的更改
  • 它 看来我——以及每个团队 想要工作的成员 项目——必须手动编辑他们的 子存储库的.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

【问题讨论】:

  • “递归结帐”是什么意思?
  • 您可以在系统上存储一次凭据,但除非您安装密钥环扩展并使其正常工作,否则密码将采用明文形式。如果没问题,请告诉我,我会告诉你怎么做。这将无需编辑存储库中的 hgrc 文件来添加身份验证。
  • 这听起来像是您应该通过 mercurial@selenic.com 与我们讨论而不是把它放在这里。 StackOverflow 不是接触 Mercurial 社区的正确方式。
  • @Lasse:**Recursive** 通过递归,意味着从仅处理根存储库开始使用子存储库,尽可能使用 HgTortoise(一次设置)。

标签: mercurial subrepos


【解决方案1】:

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

现在看来

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

简称hg status --subreposhg status -S

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

无需将用户名和密码放入.hg/hgrc 文件——您应该配置caching of HTTP credentials in Mercurial

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

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

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

是的,您错过了 Mercurial 如何知道您想要哪些子存储库。请参阅文档on the wikithe Kick Start guide

【讨论】:

  • 编辑 hgrc 文件,可能是为了添加身份验证,以避免每次推送都输入用户名/密码 X 次。
  • 感谢 Lasse,我刚刚阅读了问题末尾的注释大博客,这让我得出了相同的结论。
  • @Martin:感谢您的回复。 关于 hg status -S 昨晚发现命令开关。太棒了:现在可以在 subrepos 中看到我在做什么。
  • @Martin:关于密钥环扩展昨晚也遇到了这个问题。找到了 linux 的说明(我在 Windows 上),并提到我已经通过 HgTortoise 安装了它。但是 HgTortoise 中没有关于如何使用 it 的说明...仍在尝试弄清楚。
  • @Lasse @Martin: Security 是的,出于这个原因正在编辑 .hgrc。仍在试图弄清楚为什么 user:pwd 在路径中存在差异,或者在 [auth] 部分中分开。 HgTortoise 似乎直接将它们写入路径。它是否使用路径,如果没有指定 user:pwd 则回退到 [auth]?如果是这样,如果我不知道密钥环,我可以在全局设置中使用 [auth] 部分吗?
猜你喜欢
  • 2011-03-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-02-21
  • 1970-01-01
  • 2011-05-06
  • 2019-01-08
相关资源
最近更新 更多