views:

1202

answers:

3

Is there a way to configure TortoiseHg to store my password?

I have a project hosted on Google Code that I access using TortoiseHg. Whenever I want to push changes to Google Code TortoiseHg prompts me for a username and password. Google Code requires me to use an auto-generated password, and it gets quite repetitive to look it up every time.

+16  A: 

You can change your push URL to https://username:[email protected]/repo.

This is explained in Google Code's and Mercurial's FAQs.

EDIT: Mercurial FAQ explains another way to do it:

With Mercurial 1.3 you can also add an auth section to your hgrc file:
[auth]
example.prefix = https://hg.example.net/
example.username = foo
example.password = bar
Nicolás
I should have known it would be a FAQ... thanks!
emddudley
+8  A: 

If you want to configure it via TortoiseHg, Repository Setting dialog is available. After opening the dialog, please switch to 'Sync' tab. You can add a path with HTTPS auth information.

http://tortoisehg.bitbucket.org/manual/0.9/settings.html#module-web.settings

kuy
+5  A: 

As far as I understand, both the answers suggest storing your username and password unencrypted, in plain-text, which is a bit of a no-no.

You should use the Keyring extension instead, as it has been specifically designed for securely saving authentication passwords. It already comes bundled with TortoiseHg, so all you have to do is activate it.

In order to do this, you have to write the following in your mercurial.ini file, and you'll be good to go:

[extensions]
mercurial_keyring=
Vlad