Mercurial [auth] section

4

1

I'm new to mercurial, and I'm trying to set up hgrc in such a way that I can push to the Google Code repository without having to type the password each time. I could just specify a https://user:pass@project.googlecode.com/ repository under paths.default, but that seems messy. Thus, I'm trying to use the [auth] section, which, from what I can tell, is recommended over the first solution. So far I've set it up like this:

[auth]
myproject.prefix = myproject.googlecode.com/hg
myproject.username = my.username
myproject.password = ******
myproject.schemes = https

But I don't know where to go from here. Trying to push gives:

abort: repository default-push not found!

I somehow have to specify the default repository to use (myproject), or something like that, but how?

Felix

Posted 2010-07-03T00:48:02.527

Reputation: 613

Answers

5

Found the answer myself. It seems Mercurial smartly matches entries in [auth] with entries in path. In this case, a correct hgrc would be:

[paths]
default = https://myproject.googlecode.com/hg
[auth]
myproject.prefix = myproject.googlecode.com/hg
myproject.username = my.username
myproject.password = ******
myproject.schemes = https

Felix

Posted 2010-07-03T00:48:02.527

Reputation: 613