Commit Graph

26 Commits

Author SHA1 Message Date
Alexis S. L. Carvalho
40dca7e9cd HTTPS: fix python2.3, persistent connections, don't explode if SSL is not available
The urllib2 differences between python 2.3 and 2.4 are hidden by
using keepalive.py, which also gives us support for persistent
connections.

Support for HTTPS is enabled only if there's a HTTPSHandler class in
urllib2.

It's not possible to have separate classes as handlers for HTTP and
HTTPS:  to support persistent HTTPS connections, we need a class that
inherits from both keepalive.HTTPHandler and urllib2.HTTPSHandler.  If
we try to pass (an instance of) this class and (an instance of) the
httphandler class to urllib2.build_opener, this function ends up getting
confused, since both classes are subclasses of the HTTPHandler default
handler, and raises an exception.
2006-07-06 03:14:55 -03:00
Alexis S. L. Carvalho
26477ce2c8 Fix push over https.
Without this patch, python gives me a
TypeError: write() argument 1 must be string or read-only buffer, not file
2006-07-03 00:23:58 -03:00
Alexis S. L. Carvalho
00abec0ffe Allow http://user@example.com URLs (i.e. without passwords) 2006-07-03 00:23:56 -03:00
Thomas Arendsen Hein
58e95b6ac7 Make "[web] allow_push, deny_push" and "[http_proxy] no" use ui.configlist. 2006-06-26 16:47:24 +02:00
Vadim Gelfer
df5378a901 remove duplicate code. 2006-06-21 22:45:29 -07:00
Vadim Gelfer
f76d70d9bf http client: better work with authorization errors, broken sockets. 2006-06-20 15:23:54 -07:00
Vadim Gelfer
ce407e5396 push over http: client support.
stream bundle data using PUT request.
2006-06-20 15:17:28 -07:00
Vadim Gelfer
d0da6a6a6f httprepo: make "http://user:pass@host/" urls work 2006-06-16 10:19:45 -07:00
Vadim Gelfer
1df1c4def9 httprepo: fix small bug in authentication. 2006-06-16 10:02:59 -07:00
Vadim Gelfer
f739175f8c http: query server for capabilities 2006-06-15 17:07:30 -07:00
Vadim Gelfer
9117f9f380 extend network protocol to stop clients from locking servers
now all repositories have capabilities slot, tuple with list of names.

if 'unbundle' capability present, repo supports push where client does
not need to lock server.  repository classes that have unbundle capability
also have unbundle method.

implemented for ssh now, will be base for push over http.

unbundle protocol acts this way.  server tells client what heads it
has during normal negotiate step.  client starts unbundle by repeat
server's heads back to it.  if server has new heads, abort immediately.
otherwise, transfer changes to server.  once data transferred, server
locks and checks heads again.  if heads same, changes can be added.
else someone else added heads, and server aborts.

if client wants to force server to add heads, sends special heads list of
'force'.
2006-06-15 16:37:23 -07:00
Vadim Gelfer
d71b1891cb http client: support persistent connections.
uses keepalive module from urlgrabber package.  tested against "hg serve",
cgi server, and through http proxy.  used ethereal to verify that only
one tcp connection used during entire "hg pull" sequence.

if server supports keepalive, this makes latency of "hg pull" much lower.
2006-06-15 12:57:59 -07:00
Vadim Gelfer
46bfa5a813 http: fix many problems with url parsing and auth. added proxy test.
problems fixed:

- https scheme handled properly for real and proxy urls.

- url of form "http://user:password@host:port/path" now ok.

- no-proxy check uses proper host names.
2006-05-22 15:42:49 -07:00
Vadim Gelfer
36e6b802b2 http: print better error if exception happens. 2006-05-22 09:00:24 -07:00
Thomas Arendsen Hein
95d74b6df3 Catch urllib's HTTPException and give a meaningful error message to the user.
Usually urllib only throws HTTPError exceptions, which already are a subclass
of IOError.
2006-05-16 09:35:38 +02:00
Vadim Gelfer
2b273c6862 prompt user for http authentication info
in interactive mode, mercurial now asks the user for the username and
password when the server requires it. the previous behavior was to fail
with an http 401.

based on patch from eric jaffe <jaffe.eric@gmail.com>.
2006-05-14 17:37:17 -07:00
Thomas Arendsen Hein
f1f4d4860e Catch HTTPException when reading from remote http repository.
If the server dies very early, an httplib.IncompleteRead exception may be
raised, because httplib can't read a single byte. Catching all HTTPException
subclasses here will prevent ugly backtraces for similar things, too.
2006-03-29 12:45:33 +02:00
Vadim Gelfer
57551cb331 make push over http print good error message. 2006-03-09 12:18:59 -08:00
Vadim Gelfer
d1f78f49f0 add preoutgoing and outgoing hooks.
preoutgoing lets prevent pull over http or ssh.
outgoing lets notify after pull.
2006-02-17 08:26:21 -08:00
Benoit Boissinot
06e39e559b i18n part2: use '_' for all strings who are part of the user interface 2005-10-18 18:38:39 -07:00
Benoit Boissinot
e38e94088a i18n first part: make '_' available for files who need it 2005-10-18 18:37:48 -07:00
Eric Hopper
01737b862f Fixed a bug in my changes to httprepo.py 2005-10-03 16:07:54 -07:00
Eric Hopper
92bfd43284 Fix same performance bug as c3654cfaa77 but for httprepo.py instead. 2005-10-03 15:06:46 -07:00
Matt Mackall
5989cc8682 Set the user agent for httprepo communication 2005-09-27 18:30:54 -07:00
Bryan O'Sullivan
d5a9cb0366 Fix lots of exception-related problems.
These have been around since the Big Code Split.
2005-09-14 15:41:22 -07:00
mpm@selenic.com
e175fdde9b Break apart hg.py
- move the various parts of hg.py into their own files
- create node.py to store node manipulation functions
2005-08-27 14:21:25 -07:00