Mercurial 似乎忽略了它的配置 .hgrc,为什么?

Mercurial seems ignoring its config .hgrc, why?

我为我的 .hgrc 数据预配置了一个 login/pass,尽管 mercurial 忽略了它:

[auth]
becpg.prefix = https://becpg.fr/hg/becpg-community
becpg.username = read-only
becpg.password = read-only

试图克隆它,我得到这个:

$ hg clone https://becpg.fr/hg/becpg-community
http authorization required for https://www.becpg.fr/hg/becpg-community
realm: beCPG repositories
user: 

手动给他登录名和密码,没有问题就接受了。

跟踪 mercurial 进程,我发现是的,它在我家找到了我的 .hgrc,并读取了它:

15751 open("/home/myusername/.hgrc", O_RDONLY) = 3
15751 fstat(3, {st_mode=S_IFREG|0600, st_size=112, ...}) = 0
15751 fstat(3, {st_mode=S_IFREG|0600, st_size=112, ...}) = 0
15751 lseek(3, 0, SEEK_CUR)             = 0
15751 lseek(3, 0, SEEK_CUR)             = 0
15751 fstat(3, {st_mode=S_IFREG|0600, st_size=112, ...}) = 0
15751 read(3, "[auth]\nbecpg.prefix = https://becpg.fr/hg/becpg-community\nbecpg.username = read-only\nbecpg.password = read-only\n", 4096) = 112
15751 read(3, "", 4096)                 = 0
15751 close(3)                          = 0

可能是什么原因?

$ hg clone https://becpg.fr/hg/becpg-community
http authorization required for https://www.becpg.fr/hg/becpg-community

您尝试从 becpg.fr 克隆,然后授权请求 www.becpg.fr

我相信你被重定向了。 试试这个:

[auth]
becpg.prefix = www.becpg.fr/hg/becpg-community
becpg.username = read-only
becpg.password = read-only