[issue2590] Authentication - flush prompts

Steve Streeting bugs at mercurial.selenic.com
Wed Jan 12 11:04:55 UTC 2011


New submission from Steve Streeting <steve at torusknot.com>:

At present, Mercurial doesn't provide a mechanism to externalise 
authentication in the way that git does via (SSH_ASKPASS is used for both 
SSH and HTTP auth on Git). Therefore, when writing a GUI for Mercurial the 
only real way to reliably answer all authentication prompts is to watch 
stderr for them and feed responses to stdin. But with Python's output 
buffering, this doesn't always work. But at the same time, you don't want to 
turn off output buffering entirely for the whole Python program.

I modified hg (see attached) to make sure that prompts for username and 
password are always flushed immediately, without affecting anything else. 
This allows reliable authentication communication with hg via something 
other than a plain terminal.

I don't know if this is the best way, but it works for me when nothing else 
would. Another way of resolving it would be for Mercurial to delegate to 
SSH_ASKPASS if set for all authentication and not only for SSH (which is 
what Git does).

----------
files: hg_patch_prompting.diff
messages: 14881
nosy: sjstreeting
priority: bug
status: unread
title: Authentication - flush prompts

____________________________________________________
Mercurial issue tracker <bugs at mercurial.selenic.com>
<http://mercurial.selenic.com/bts/issue2590>
____________________________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hg_patch_prompting.diff
Type: application/octet-stream
Size: 1443 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20110112/1c2b1cac/attachment.obj>


More information about the Mercurial-devel mailing list