Configure Hg to not prompt for a username and password on the command line

When I try to clone an https authenticated Mercurial repository (e.g. from the oven), it asks for my username

C:\temp\test>hg clone https://<my-login-name>.kilnhg.com/Code/Repositories/Group/test
http authorization required
realm: kiln
user:

We want to call a command hg clonefrom our GUI application with any URL provided by the user, and ask the user on demand for a username and password, if necessary.

How do I configure Mercurial to invoke an arbitrary script that returns a username / password, similar to scripts whose paths are defined in environment variables GIT_ASKPASSor SSH_ASKPASSfor Git?

+5
source share
2 answers

hgrc (mercurial.ini Windows):

[auth]
foo.prefix = example.com/path
foo.username = user
foo.password = password

, hgrc.

. docs hgrc.


: TortoiseHg ( SyncWidget.inclicked SyncWidget.pullclicked sync.py), , TortoiseHg, , , -, URL- auth, , , , URL ( ) hg pull.

, .

+8

hg clone https://user:password@host:port

?

+5

All Articles