自从我使用Mercurial 4.5.3移动到Ubuntu 18.04后,我看到以下警告:
(SHA-1 fingerprint for bitbucket.org found in legacy [hostfingerprints] section; if you trust this fingerprint, remove the old SHA-1 fingerprint from [hostfingerprints] and add the following entry to the new [hostsecurity] section: bitbucket.org:fingerprints=sha256:32:12:90:9a:70:64:82:1c:5b:52:cc:c3:0a:d0:79:db:e1:a8:62:1b:9a:9a:4c:f4:72:40:1c:a7:3a:d3:0a:8c)
现在我理解并欣赏这个警告。但是,我想让它沉默。最好通过在.hgrc
中添加相应的部分和条目:
[hostsecurity]
bitbucket.org:fingerprints=sha256:32:12:90:9a:70:64:82:1c:5b:52:cc:c3:0a:d0:79:db:e1:a8:62:1b:9a:9a:4c:f4:72:40:1c:a7:3a:d3:0a:8c
但无论我是否将新的[hostsecurity]
部分放在旧的[hostfingerprints]
部分之前,警告仍然显示出来。所以我正在寻找一种方法让它沉默,最好只是为了那个主机名和.hgrc
。
与一些专注于最新发行版版本的快乐人不同,我仍然有一些非常古老的发行版版本和Mercurial。因此,特别是那些较旧的Mercurial版本需要旧条目。
首先删除(注释掉)hostfingerprints
部分:
# [hostfingerprints]
# bitbucket.org = ..:..:...
然后添加新的hostsecurity部分:
hostsecurity]
bitbucket.org = sha256:..:..:... (with whatever the error message suggests)
看来您不能使用bitbucket.org:fingerprints=...
节作为警告提示。