peterh
peterh

Reputation: 1

Mercurial seems ignoring its config .hgrc, why?

I preconfigured a login/pass to my .hgrc data, despite that the mercurial ignores it:

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

Trying to clone it, I get this:

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

Giving him the login and the password manually, it is accepted without any problem.

Stracing the mercurial process, I find that yes, it finds my .hgrc in my home, and reads it in:

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

What could be the reason?

Upvotes: 1

Views: 143

Answers (1)

Marcos Zolnowski
Marcos Zolnowski

Reputation: 2807

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

You try to clone from becpg.fr, then the authorization asks for www.becpg.fr.

I believe you are being redirected. Try this:

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

Upvotes: 2

Related Questions