Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

up vote 1 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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.