[issue3191] Cloning repo with subrepo using keyring prompts for authentication

Eric Blood bugs at mercurial.selenic.com
Mon Jan 9 21:43:49 CST 2012


New submission from Eric Blood <eblood66 at gmail.com>:

When cloning a repository which contains a sub-repository (from a remote
HTTP repository that requires authentication) and using the Mercurial
keyring extension hg prompts for a password when it should use the stored
password.

I reproduced this with these steps (using Rhodecode as the remote repository):

1. Create a remote repository (eg http://myserver/Test)
2. Create another remote repository (eg http://myserver/Subtest)
3. Create an [auth] entry to provide the username for myserver
4. Enable the Keyring extension
5. Clone Test locally (c:\Test)
6. Clone Subtest locally (c:\Test\Subtest)
7. Create .hgsub with Subtest = ../Subtest and add
8. Create a file in Subtest and add
9. Commit Subtest and then Test
10. Push Test to remote repository
11. At this point there should have only been a single password prompt.
12. Clone Test from the remote server to another directory.
13. It will prompt for the password again.

This is with version 2.0.2.  Looking at the debug output and inspecting the
traffic on the wire it looks like Mercurial is sending the listkeys command
to the remote server twice in a row.  The keyring interprets the duplicate
requests as indicating there was an authorization failure and doesn't use
the stored password for the second request.

I think the problem is in hgsubrepo._get (subrepo.py) where it clones the
subrepo and then calls bookmarks.updatefromremote.  I think it should only
call bookmarks.updatefromremote when using pull, not clone.

----------
messages: 18557
nosy: eblood66
priority: bug
status: unread
title: Cloning repo with subrepo using keyring prompts for authentication

____________________________________________________
Mercurial issue tracker <bugs at mercurial.selenic.com>
<http://mercurial.selenic.com/bts/issue3191>
____________________________________________________


More information about the Mercurial-devel mailing list