[PATCH] allow http authentication information to be specified in the configuration

Sune Foldager cryo at cyanite.org
Sun May 3 12:52:38 CDT 2009


On 03/05/2009, at 18.59, Martin Geisler wrote:

>> +def dumpdict(dict):
>> +    print '{' + ', '.join(['%s: %s' % (k, dict[k]) for k in  
>> sorted(dict.iterkeys())]) + '}'
>
> pprint.pprint does the same.

Ah, nice!.  I have yet to explore the corners and nooks of the python  
libraries. I'll change the test code.

>> +        except Abort, e:
>> +            print 'abort'
>
> Is there a reason for not printing the exception?

Well, I didn't feel it added any value to the test, but I can change  
it if people would prefer it. I think I liked the less clutter while  
developing and visually inspecting the tests :).

> What happens if the user specifies
>
>  x.prefix = http://example.org/
>  x.schemes = https

Your homedir gets wiped!.. no, it ignores the schemes-argument. I'll  
add a test for that.

Martin and I, in private conversation, discussed changing the  
configuration to having no schemas argument but instead a "allow-http"  
or similar. I like both ways, but since the other one isn't simpler  
(still has the argument), I think this one is better as:

a) Makes the schemes more explicit.
b) Allows us to expand to ssh later on (which should probably not be  
very difficult), and if we do...
c) Servers might use entirely different auth for ssh and http(s).  
Would still be nice to be able to specify the scheme in the uri like  
now.

Many (most) people would probably write out the uri prefix with schema  
directly, anyway.


I'll repost with updated tests and tip-rebase shortly.

-- 
Sune Foldager.



More information about the Mercurial-devel mailing list