Commit Graph

74 Commits

Author SHA1 Message Date
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
Eric Hopper
68f926ec7d Adding changegroupsubset and lookup to web protocol so pull -r and
clone -r can be supported.
2006-09-09 18:25:06 -07:00
Thomas Arendsen Hein
c2e923aaf7 Catch python2.3's IndexError with bogus http proxy settings. (issue203) 2006-10-15 21:09:56 +02:00
Thomas Arendsen Hein
0a7b982aa6 Whitespace/Tab cleanup 2006-10-01 19:26:33 +02:00
TK Soh
72015b7657 do not disclose proxy user and password in debug messages 2006-09-26 14:40:21 -05:00
Benoit Boissinot
2caa3e642d fix warnings spotted by pychecker 2006-09-18 17:43:31 +02:00
Thomas Arendsen Hein
d2082f10fc Never apply string formatting to generated errors with util.Abort.
Otherwise error messages containing % chars yield errors or worse.
Fixed (hopefully) all users of util.Abort.
2006-09-08 09:36:18 +02:00
Vadim Gelfer
dc377b58c1 update copyrights. 2006-08-12 12:30:02 -07:00
Vadim Gelfer
b7a96d1742 clean up hg.py: move repo constructor code into each repo module 2006-07-31 07:11:12 -07:00
Vadim Gelfer
0778999161 hooks: add url to changegroup, incoming, prechangegroup, pretxnchangegroup hooks
all repository classes now have url() method that returns url of repo.
2006-07-25 13:50:32 -07:00
Vadim Gelfer
9ea4436262 add support for streaming clone.
existing clone code uses pull to get changes from remote repo.  is very
slow, uses lots of memory and cpu.

new clone code has server write file data straight to client, client
writes file data straight to disk.  memory and cpu used are very low,
clone is much faster over lan.

new client can still clone with pull, can still clone from older servers.
new server can still serve older clients.
2006-07-14 11:17:22 -07:00
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