TortoiseHg not remembering password
Created originally on Bitbucket by Balfa (Mo Cassidy)
My passwords for a given HTTPS host used to be saved indefinitely. The only time I'd need to retype it would be when I actually changed my password.
More recently, and I'm not sure if it changed with a particular version of THG, or if it changed when I switched from XP to Win 7, it's only been saving it on a per-repository level. So every fresh clone would cause a password prompt (or half a dozen prompts, including subrepos), but from then on, pulls and pushes for that local copy to our central server would not prompt. My colleague maintains he's always had this problem on Windows 7.
Here are the extensions and auth sections from %USERPROFILE%\mercurial.ini:
[extensions] hgext.convert= mercurial_keyring =
[auth] ufx.prefix = https://dtx-dvs-scr-201/hg/ ufx.username = Balfa
uf.prefix = https://hg.COMPANYNAME.com/hg/ uf.username = Balfa
Just now I tried a command-line clone, and after first asking for the password, it seemed to permanently resolve the problem!
First attempt (prompted for password):
C:\Users\Balfa\Documents\Dev\Hg!Hg_Sandbox\xmlparser>hg clone --debug --noupdate https://hg.COMPANYNAME.com/hg/Console/ XMLParserCmdPrompt/ using https://hg.COMPANYNAME.com/hg/Console/XMLParserCmdPrompt/ sending capabilities command using auth.uf.* for authentication hg.COMPANYNAME.com certificate matched fingerprint d1:79:5d:5f:9c:15:d2:b2:c7:ea:70:01:85:52:df:d2:1a:0c:5d:76 Keyring URL: https://hg.COMPANYNAME.com/hg/ Username found in .hg/hgrc: Balfa Keyring password found. Url: https://hg.COMPANYNAME.com/hg/Console/XMLParserCmdPrompt/, user: Balfa, passwd: * using auth.uf.* for authentication hg.COMPANYNAME.com certificate matched fingerprint d1:79:5d:5f:9c:15:d2:b2:c7:ea:70:01:85:52:df:d2:1a:0c:5d:76 Keyring URL: https://hg.COMPANYNAME.com/hg/ Username found in .hg/hgrc: Balfa http authorization required realm: hg.COMPANYNAME.com user: Balfa (fixed in .hg/hgrc) password: Saving password for Balfa to keyring Manually entered password. Url: https://hg.COMPANYNAME.com/hg/Console/XMLParserCmdPrompt/, user: Balfa, passwd: * * * * using auth.uf.* for authentication hg.COMPANYNAME.com certificate matched fingerprint d1:79:5d:5f:9c:15:d2:b2:c7:ea:70:01:85:52:df:d2:1a:0c:5d:76 destination directory: XMLParserCmdPrompt sending heads command using auth.uf.* for authentication Keyring URL: https://hg.COMPANYNAME.com/hg/ Cached auth data found. Url: https://hg.COMPANYNAME.com/hg/Console/XMLParserCmdPrompt/, user: Balfa, passwd: * * * * using auth.uf.* for authentication hg.COMPANYNAME.com certificate matched fingerprint d1:79:5d:5f:9c:15:d2:b2:c7:ea:70:01:85:52:df:d2:1a:0c:5d:76 requesting all changes sending changegroup command using auth.uf.* for authentication Keyring URL: https://hg.COMPANYNAME.com/hg/ Cached auth data found. Url: https://hg.COMPANYNAME.com/hg/Console/XMLParserCmdPrompt/, user: Balfa, passwd: * * * * using auth.uf.* for authentication hg.COMPANYNAME.com certificate matched fingerprint d1:79:5d:5f:9c:15:d2:b2:c7:ea:70:01:85:52:df:d2:1a:0c:5d:76 adding changesets changesets: 1 chunks add changeset 7b411d89db31
Subsequent attempts (do not prompt):
C:\Users\Balfa\Documents\Dev\Hg!Hg_Sandbox\xmlparser>hg clone --debug --noupdate https://hg.COMPANYNAME.com/hg/Console/ XMLParserCmdPrompt/ using https://hg.COMPANYNAME.com/hg/Console/XMLParserCmdPrompt/ sending capabilities command using auth.uf.* for authentication hg.COMPANYNAME.com certificate matched fingerprint d1:79:5d:5f:9c:15:d2:b2:c7:ea:70:01:85:52:df:d2:1a:0c:5d:76 Keyring URL: https://hg.COMPANYNAME.com/hg/ Username found in .hg/hgrc: Balfa Keyring password found. Url: https://hg.COMPANYNAME.com/hg/Console/XMLParserCmdPrompt/, user: Balfa, passwd: * * * * using auth.uf.* for authentication hg.COMPANYNAME.com certificate matched fingerprint d1:79:5d:5f:9c:15:d2:b2:c7:ea:70:01:85:52:df:d2:1a:0c:5d:76 destination directory: XMLParserCmdPrompt sending heads command using auth.uf.* for authentication Keyring URL: https://hg.COMPANYNAME.com/hg/ Cached auth data found. Url: https://hg.COMPANYNAME.com/hg/Console/XMLParserCmdPrompt/, user: Balfa, passwd: * * * * using auth.uf.* for authentication hg.COMPANYNAME.com certificate matched fingerprint d1:79:5d:5f:9c:15:d2:b2:c7:ea:70:01:85:52:df:d2:1a:0c:5d:76 requesting all changes sending changegroup command using auth.uf.* for authentication Keyring URL: https://hg.COMPANYNAME.com/hg/ Cached auth data found. Url: https://hg.COMPANYNAME.com/hg/Console/XMLParserCmdPrompt/, user: Balfa, passwd: * * * * using auth.uf.* for authentication hg.COMPANYNAME.com certificate matched fingerprint d1:79:5d:5f:9c:15:d2:b2:c7:ea:70:01:85:52:df:d2:1a:0c:5d:76 adding changesets changesets: 1 chunks add changeset 7b411d89db31
All clones via command line or THG GUI now work flawlessly and never ask for a password, even for repos I'd never cloned from our central serer before. I'm really not sure what to make of this, but it's confusing!
PS Note that in the above debug outputs, I had to change a string of multiple stars without spaces into "* * * *", in order to prevent bitbucket from applying markup.