4

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:[email protected]/ 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?

quack quixote
  • 42,186
  • 14
  • 105
  • 129
Felix
  • 613
  • 1
  • 8
  • 22

1 Answers1

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
  • 613
  • 1
  • 8
  • 22