代码之家  ›  专栏  ›  技术社区  ›  javydreamercsw

Mercurial:启用git subrepo

  •  15
  • javydreamercsw  · 技术社区  · 7 年前

    最近默认情况下禁用了此行为。该消息提示您查看帮助页面,但没有帮助,至少对我没有帮助。

     "subrepos"
        ----------
    
        This section contains options that control the behavior of the
        subrepositories feature. See also 'hg help subrepos'.
    
        Security note: auditing in Mercurial is known to be insufficient to
        prevent clone-time code execution with carefully constructed Git subrepos.
        It is unknown if a similar detect is present in Subversion subrepos. Both
        Git and Subversion subrepos are disabled by default out of security
        concerns. These subrepo types can be enabled using the respective options
        below.
    
        "allowed"
            Whether subrepositories are allowed in the working directory.
    
            When false, commands involving subrepositories (like 'hg update') will
            fail for all subrepository types. (default: true)
    
        "hg:allowed"
            Whether Mercurial subrepositories are allowed in the working
            directory. This option only has an effect if "subrepos.allowed" is
            true. (default: true)
    
        "git:allowed"
            Whether Git subrepositories are allowed in the working directory. This
            option only has an effect if "subrepos.allowed" is true.
    
            See the security note above before enabling Git subrepos. (default:
            false)
    
        "svn:allowed"
            Whether Subversion subrepositories are allowed in the working
            directory. This option only has an effect if "subrepos.allowed" is
            true.
    
            See the security note above before enabling Subversion subrepos.
            (default: false)
    

    我认为它在项目的hgrc中添加了以下内容:

    [subrepos]
    git:allowed
    

    但它给出了一个解析错误。有人知道正确的格式吗?还有,为什么他们决定禁用这个?每次我签出此项目时,我都必须进行此更改?

    3 回复  |  直到 7 年前
        1
  •  15
  •   Kafumanto    7 年前

    在您的 .hgrc 文件,您必须添加:

    [subrepos]
    git:allowed = true
    
        2
  •  4
  •   Shane Holloway    6 年前

    我在我的 ~/.hgrc 配置并验证 allowed git:allowed 按预期启用和禁用功能。

    [subrepos]
    allowed = True
    hg:allowed = True
    git:allowed = True
    svn:allowed = True
    
        3
  •  1
  •   AlwaysTraining    7 年前

    在Debian 8 docker容器Mercurial 3.1.2版中,Mercurial在将回购和子回购迁移到phabricator后停止了为我们工作。报告称:

    abort: subrepo type git not allowed
    (see 'hg help config.subrepos' for details)
    

    首先,要看到帮助

    hg help subrepos
    

    但这没有用。上述建议的语法。hgrc不适用于我们。然而,这确实:

    [subrepos]
    allowed = hg git
    
    推荐文章