Commit Graph

86 Commits

Author SHA1 Message Date
Joel Rosdahl
4f8012378a Remove unused imports 2008-03-06 22:23:41 +01:00
Joel Rosdahl
5dae3059a0 Expand import * to allow Pyflakes to find problems 2008-03-06 22:23:26 +01:00
Alexis S. L. Carvalho
961a45df72 merge with crew-stable 2008-02-03 21:47:07 -02:00
Alexis S. L. Carvalho
f636dc58cf httprepo: use separate handlers for HTTP and HTTPS
This is needed to keep the code in keepalive.py from sharing
the same connection between HTTP and HTTPS.

cd1a6ad30c82 explains why we were using a single handler.

This should fix issue892.
2008-02-03 21:03:46 -02:00
Alexis S. L. Carvalho
67c49a0cf5 move __del__ from httprepository to basehttphandler
This should prevent the next patch from reopening an issue fixed by
b7ccb4b856de.
2008-02-03 21:03:46 -02:00
Dirkjan Ochtman
4ea6b6bcae send conservatively capitalized HTTP headers 2008-01-23 14:28:25 +01:00
Christian Ebert
5c18a69d2e Prefer i in d over d.has_key(i) 2008-01-20 14:39:25 +01:00
Alexis S. L. Carvalho
f8788ac266 httprepo: give self._url and the netloc to the password manager
This should hide some differences between different python versions.
2007-11-09 20:21:35 -02:00
Elliott Peele
dae15f3456 https url handling: usernames and passwords were registered to the wrong url 2007-10-30 16:54:25 -07:00
Sebastian Hauer
14709cb72b httprepo: ignore environment proxies when proxies are disabled 2007-10-24 22:15:45 +02:00
Alexis S. L. Carvalho
ddf41e005d Merge with crew-stable 2007-09-24 19:14:18 -03:00
Alexis S. L. Carvalho
4b5f93a4e8 Push over HTTP: really tell the user the size of the bundle 2007-09-24 19:00:11 -03:00
Bryan O'Sullivan
6fbb9f2f2f Push capability checking into protocol-level code. 2007-08-27 14:48:08 -07:00
Bryan O'Sullivan
eba82ab39c Turn capabilities into a mutable set, instead of a fixed tuple. 2007-08-27 14:16:04 -07:00
Alexis S. L. Carvalho
1ee06d75a7 Merge with crew-stable 2007-08-17 23:20:13 -03:00
Peter Meerwald
263e23ecf3 recognize user:password in URLs that include port numbers.
when giving user/pwd in an URL, eg.
hg pull http://user:pwd@host.com:666/hg/something,
hg would still ask for user/pwd in interactive mode (or fail in
non-interactive)
2007-08-17 22:43:38 -03:00
Matt Mackall
2bf7253b8a fix-up references to repo.RepoError 2007-08-15 16:10:24 -05:00
Alexis S. L. Carvalho
9107d93d2f merge with crew-stable 2007-08-06 01:00:10 -03:00
Alexis S. L. Carvalho
56d1444a26 httprepo: quote the path part of the URL
This should fix a 'hg clone "http://hg.example.org/path with spaces/"'

The code tries to do the right thing when the user passes a path that's
already escaped in part (e.g. "http://hg.example.org/path%20with spaces/").

If we're redirected, urllib2 will happily follow the URL it's given
without escaping anything.  I'm not sure what we would have to hook
to work around that.
2007-08-06 00:35:06 -03:00
Thomas Arendsen Hein
d486a44410 Removed deprecated hg:// and old-http:// protocols (issue406) 2007-07-08 09:54:42 +02:00
Thomas Arendsen Hein
12ab0bc744 Added full URL to debug output if something doesn't look like an http hg repo.
This way it is easier to debug problems with failing subcommands, like
changegroupsubset due to permission problems, when generally accessing
the repository works fine.
2007-06-29 11:13:36 +02:00
Alexis S. L. Carvalho
b8f177ebbe Work around urllib2 digest auth bug with Python < 2.5
This should fix issue570.
2007-06-22 14:32:54 -03:00
Thomas Arendsen Hein
483231d996 Cleanup of whitespace, indentation and line continuation. 2007-06-19 08:06:37 +02:00
Thomas Arendsen Hein
49220695bc Removed trailing whitespace and tabs from python files 2007-06-06 20:22:52 +02:00
Thomas Arendsen Hein
5cf9fd7310 Merge with crew-stable 2007-04-19 17:54:43 +02:00
Thomas Arendsen Hein
f828391cdc Avoid float rounding errors when checking http protocol version. 2007-04-19 17:52:42 +02:00
Alexis S. L. Carvalho
47cb22b5a2 Merge with crew-stable 2007-03-16 00:45:18 -03:00
Alexis S. L. Carvalho
93eb041452 Merge with crew-stable 2007-03-04 09:03:21 -03:00
Andrei Vermel
3fdb0dcf56 Close keepalive connections to fix server traceback 2007-02-19 12:38:58 +03:00
Benoit Boissinot
a76c975e9d Subclass file with a __len__ method instead of setting Content-length
This is necessary for the next patch to work with python2.3
Refactor the subclassing of send()
2007-01-08 16:12:35 +01:00
Benoit Boissinot
4af82ec145 merge with -stable 2007-01-15 18:23:21 +01:00
Thomas Arendsen Hein
46055c07ca sync with -stable 2007-01-02 22:40:52 +01:00
Benoit Boissinot
0a972b6964 fix handling of multiple Content-type headers
This can happen if an error happens while sending
application/mercurial-0.1 content. The error page will
be sent resulting (for at least lighttpd) in the following
headers:
Content-type: application/mercurial-0.1
Content-type: text/html
which result in req.proto = 'application/mercurial-0.1, text/html'

fix issue344
2006-12-29 05:27:48 +01:00
Matt Mackall
296d6a7cb8 Simplify i18n imports 2006-12-14 20:25:19 -06:00
Matt Mackall
f17a4e1934 Replace demandload with new demandimport 2006-12-13 13:27:09 -06:00
Alexis S. L. Carvalho
cebbac3269 fix push over HTTP to older servers 2006-11-21 23:08:29 -02:00
Matt Mackall
312ace343c unduplicate bundle writing code from httprepo 2006-11-15 23:37:45 -06:00
Matt Mackall
96305ed7ba remove duplicate zgenerator in httprepo 2006-11-15 15:51:58 -06:00
Thomas Arendsen Hein
641503fdd4 Try hgweb unbundle methods in the order presented by the server.
If no common bundle format is found, push is aborted.
2006-11-02 15:30:45 +01:00
Thomas Arendsen Hein
b933ddcd3f Client support for hgweb unbundle with versions. 2006-11-02 14:58:55 +01:00
Benoit Boissinot
f8e3315daa hgweb: if the server supports it, send a compressed bundle 2006-11-01 22:01:30 +01:00
Alexis S. L. Carvalho
7c0dca42a7 Use httpconnection even with proxies.
This should give us HTTP keepalive when we talk to proxies and
should allow us to stream a file in unbundle (instead of
reading everything into a string).

This should fix issue376.
2006-11-01 14:53:11 -03:00
Thomas Arendsen Hein
4d0e63ed13 Inform the user about the new URL when being redirected via http.
Additionally the changed code ensures that the new URL is used,
even if it doesn't end with the query string.
2006-10-28 23:05:57 +02:00
Thomas Arendsen Hein
fcfb50e224 Stripping of query string (since b7aa16033ab7) stripped too much (issue327)
rstrip(qs) not only strips qs from the right, but it continues stripping
every char at the end of the URL that occurs on qs.
2006-10-28 11:00:59 +02:00
Thomas Arendsen Hein
cdecbefe20 Turn bundle file into a string for http push, for urllib2 over proxies. 2006-10-27 19:24:57 +02:00
Thomas Arendsen Hein
d3647fdf40 Force the content-length header to be a string in httprepo.unbundle.
(Needed for Python2.3 compatibility)
2006-10-27 18:30:53 +02:00
Thomas Arendsen Hein
a0f9f54446 Use the new UnexpectedOutput exception in httprepo, too. 2006-10-27 18:20:28 +02:00
Benoit Boissinot
a44e11eb87 httprepo: record the url after a request, makes pull + redirect works
POST+redirect doesn't work in python, as a workaround we record the url
from the previous GETs so that when we do a POST it uses the redirected url
fix issue327
2006-10-27 15:02:27 +02:00
Alexis S. L. Carvalho
b1e6fe8df6 Work around a urllib2 bug in Python < 2.4.2
When urllib2 base64-encodes the password needed for the Proxy-authorization
header, it forgets to remove the trailing "\n".  Later, a "\r\n" sequence
is appended to every header, as required by the standard.

Some proxies interpret the resulting "\n\r\n" sequence in the same way as
"\r\n\r\n": end of headers.  This usually doesn't cause trouble for this
request, but when the proxy tries to read the next one, it thinks the
request starts with some garbage and returns a "400 - Bad Request" error.
2007-03-16 00:22:53 -03:00
Matt Mackall
7b5e14caef httprepo: add support for passing lookup exception data 2006-10-18 02:08:36 -05:00