Search code examples
mercurialcloneconfigtortoisehg

Mercurial hg flag syntax for config property not working


I have a repository that needs some [hostfingerprints] key to be working. They told me to add an --insecure flag so it doesn't ask me for the key, but it didn't work.

hg clone --insecure pathToRepository PathForTheFolderToClone

I tried instead to give the property i should have in a hgrc file, when the repository is cloned:

[hostfingerprints] hg.website.com = 88:88:88.....

But how do you use this property?. It tells me it has bad syntax:

*`hg clone --config hostfingerprints.hg.website.com = 88:88:88:88:88...88:88 pathToRepository PathForTheFolderToClone`*

Here is the error:

*abort: malformed --config option: 'hostfingerprints.hg.website.com' (use --config section.name=value)*

How do i write it, then? And why the --insecure flag doesn't work in the first place?


Solution

  • Set the hostfingerprint in your global config file, then do a normal clone. --insecure will no longer be needed.

    From the hgrc docs:

    On Unix, the following files are consulted:

    • /.hg/hgrc (per-repository)
    • $HOME/.hgrc (per-user)
    • /etc/mercurial/hgrc (per-installation)
    • /etc/mercurial/hgrc.d/*.rc (per-installation)
    • /etc/mercurial/hgrc (per-system)
    • /etc/mercurial/hgrc.d/*.rc (per-system)

    On Windows, the following files are consulted:

    • /.hg/hgrc (per-repository)
    • %USERPROFILE%.hgrc (per-user)
    • %USERPROFILE%\Mercurial.ini (per-user)
    • %HOME%.hgrc (per-user)
    • %HOME%\Mercurial.ini (per-user)
    • \Mercurial.ini (per-installation)
    • \hgrc.d*.rc (per-installation)
    • HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial (per-installation)

    hostfingerprints looks like:

    [hostfingerprints]
    hg.intevation.org = fa:1f:d9:48:f1:e7:74:30:38:8d:d8:58:b6:94:b8:58:28:7d:8b:d0