Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 3 down vote accepted

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
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .