tags:

views:

176

answers:

2

I have a big size clone to push to google code, and it takes a long time for the authenticate dialog to show up after the push is fired up, so does TortoiseHg push data first authenticate second? if so, that's stupid.

A: 

I expect it will be gathering a list of changesets from the server so it knows which local changesets do not appear on the server, and thus need to be transferred. Basically the equivalent of hg outgoing. Only once it has determined the changesets to push does it need to write anything (and potentially not, if there are no differences) so it won't authenticate until it actually needs to.

gavinb
+2  A: 

TL;DR: httplib is essentially broken here, and that causes this problem hg. People are working on fixing this.

This is an unfortunate side effect of the way urllib and httplib work. httplib/urllib won't preemptively send authorization, which is unfortunate.

The good news is that there's ongoing work to fix this, the bad news is that it looks like it'll take essentially a complete rewrite of httplib to get it to reasonable behavior. In particular, httplib is half-duplex, and has no way to peek at incoming packets (to detect an early response), so it has to send a request first before it can get a digest auth prompt (assuming use of digest auth, which is the best option). Some server implementations even close the socket once they send out a 401 Authorization Required, which actually breaks httplib completely by raising a broken pipe error. I submitted a workaround for that problem which is in hg 1.4, but it's only a user-annoyance fix, not an actual performance solution.

durin42