Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mercurial: enable git subrepo

Recently this behavior was disabled by default. The message prompts you to check the help page but it's not helpful, at least it didn't help me.

 "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)

I assumed it was adding the following to the project's hgrc:

[subrepos]
git:allowed

But it gives a parsing error. Does anyone know the right format? And also, why they decided to disable this? Each time I checkout this project I'll have to make this change?

like image 824
javydreamercsw Avatar asked Mar 30 '18 16:03

javydreamercsw


2 Answers

In your .hgrc file, you must add:

[subrepos]
git:allowed = true
like image 132
Kafu Avatar answered Sep 22 '22 02:09

Kafu


I used the following in my ~/.hgrc config and verified allowed and git:allowed both enable and disable functionality as expected.

[subrepos]
allowed = True
hg:allowed = True
git:allowed = True
svn:allowed = True
like image 25
Shane Holloway Avatar answered Sep 23 '22 02:09

Shane Holloway