views:

398

answers:

4

Hello.

I have a HTTP server with some Mercurial repositories; in which I handle digest authentication, and I found myself pushing changes to the server too often, so, I wanna know If is there any way to send the credentials (user and password) along with the hg push command?

Thanks

+2  A: 

With http authentication, I use hg push https://user:[email protected] in hgrc file, not sure if it helps here.

Sejanus
Cool... it works... tx... I found that even on TortoiseHG there is an option to add user and password, but the resulting url is with the format you have just referenced. !! thanks a lot
Jhonny D. Cano -Leftware-
Note: also if you have a Unix server, you could setup "Mercurial Server" (self contained, no need for an http server) and use ssh to authenticate: once users have done ssh-add in a session, they don't have to do anything else to work with the server (push, pull, etc.). I found that setting up Mercurial Server was even easier than setting up Apache2 with hgwebdir! But you need a Unix server. Drawback: you need to collect public keys for all the developeurs. Advantage: no password is store in clear anywhere.
Christophe Muller
A: 

There is a default password extension to automatically provide credentials. There's not much advantage to this beyond embedding the creds right in the url as Sejanus suggests. It's still plaintext, but does put your password into a separate file, the location of which you can control. Without this, the password is stored in the .hg folder in your workspace, so this might be preferable if the filesystem your workspace is on is shared.

ataylor
A: 

TortoiseHg 0.9.3 is the first version to include the mercurial_keyring extension, and I'm quite happy with it. The previous link shows the required configuration to make it work.

Mercurial 1.4.3 doesn't include it, but I hope it's just a matter of time before it will be available as a part of the Mercurial packages.

alexandrul
+1  A: 

Please use the auth section in your hgrc file. That will let you write things like:

[auth]
bb.prefix = https://bitbucket.org/
bb.username = mg
bb.password = something
Martin Geisler
Much nicer/cleaner to use the `[auth]` block
Veger