Commit Graph

66 Commits

Author SHA1 Message Date
Martin Geisler
3f7c86dc69 wrap string literals in error messages 2009-05-31 01:30:16 +02:00
Martin Geisler
750183bdad updated license to be explicit about GPL version 2 2009-04-26 01:08:54 +02:00
Dirkjan Ochtman
ed04819e2f hgweb: pre-init mimetypes module (fixes ugly bug in python-2.6.2 mimetypes)
The ugly initialization hack in mimetypes' initialization procedure can make
hg serve hit the maximum recursion depth when in threaded mode.
2009-04-27 16:29:26 +02:00
Martin Geisler
b5e430c97b hgweb: better English in IPv6 error message 2009-03-31 22:48:16 +02:00
Brodie Rao
cb9a8632f9 hgweb: fix undefined name RepoError 2009-03-27 11:17:46 -04:00
Matt Mackall
e0735a1762 error: move repo errors
rename NoCapability to CapabilityError
2009-01-12 10:42:31 -06:00
Benoit Boissinot
ea7fe6dacc remove unused variables 2008-10-28 19:25:26 +01:00
Martin Geisler
da335e4675 i18n: import _ instead of gettext 2008-10-21 17:47:49 +02:00
Martin Geisler
28fb695e9a i18n: mark strings for translation in Mercurial 2008-08-31 16:12:02 +02:00
Dirkjan Ochtman
d50a34e7a6 hgweb: all protocol functions have become generators
Using the write() callable supplied by the start_response() call is
frowned upon by the WSGI spec, returning an iterable over the content chunks
is the recommended way. Be aware, though: returning many small chunks will
slow down responses, because the server has to flush each chunk separately.
2008-06-29 15:23:09 +02:00
Benoit Boissinot
f193be73bd hgweb: remove dead code 2008-03-29 21:15:34 +01:00
Stephen Deasey
b6ba89dcec hgweb: clarify which address and port can/cannot be bound at startup (bug 769)
The error message at startup when the address/port could not be bound
was confusing:

    hg serve
    abort: cannot start server: Address already in use

Be more explicit:

    $ hg serve -a localhost
    abort: cannot start server at 'localhost:8000': Address already in use

Also be more explicit on success, showing hostname and ip address/port:

    $ hg -v serve -a localhost -p 80
    listening at http://localhost/ (127.0.0.1:80)


We are careful to handle a missconfigured machine whose hostname does not
resolve, falling back to the address given at the command line.

Remove a dead-code error message.
2008-03-10 19:25:34 +00:00
Joel Rosdahl
c26213193c Avoid importing mercurial.node/mercurial.repo stuff from mercurial.hg 2008-03-06 22:51:16 +01:00
Joel Rosdahl
4f8012378a Remove unused imports 2008-03-06 22:23:41 +01:00
Michele Cella
095d8aff18 hgweb: fixes to make hg serve prefix handling more robust 2008-01-22 22:13:29 +01:00
Michele Cella
0e20a92c0f adding "prefix" option to "hg serve" (command line and [web] section)
allows "hg serve" to serve from a different path than '/' (server root)
2008-01-09 11:15:00 +01:00
Mirko Friedenhagen
2a87bfec34 server: append to logfiles 2007-12-24 17:21:40 +01:00
Dirkjan Ochtman
a20c52b449 Use SCRIPT_NAME and PATH_INFO instead of REQUEST_URI. This is required by WSGI (fixes issue846). 2007-12-01 19:19:08 +01:00
Dirkjan Ochtman
eb63af80e4 Less indirection in the WSGI web interface. This simplifies some code, and makes it more compliant with WSGI. 2007-11-30 18:23:18 +01:00
Patrick Mezard
7d72f53113 hgweb.server: flush log files after every access 2007-11-27 23:55:03 +01:00
Benoit Boissinot
5c3e74025c merge with -stable 2007-08-09 01:07:11 +02:00
Benoit Boissinot
25ee8ea56b unobfuscate part of fec055ae35cc 2007-08-09 01:04:27 +02:00
Benoit Boissinot
258f71b5a3 merge with -stable 2007-08-08 23:00:01 +02:00
Eric Hopper
e7f6d77433 Fix hgwebdir after aaaee74b883fc144cc3472c81c61157bc69374b6 broke it. 2007-08-08 22:47:30 +02:00
Thomas Arendsen Hein
d9d3256252 removed trailing whitespace 2007-07-21 10:30:51 +02:00
Brendan Cully
a0b3ae0fbb cosmetics 2007-07-12 22:44:16 -07:00
Wesley J. Landaker
90ae651c49 Make hg serve set the wsgi.url_scheme property correctly.
This fixes the bug where hg serve with SSL will always detect the wrong
urlbase for templates. This is also part of unifying the CGI interface
and hg serve interface to both use standard wsgi.
2007-07-12 13:58:36 -06:00
Alexis S. L. Carvalho
05dd580e30 merge with crew-stable 2007-07-11 20:15:03 -03:00
Alexis S. L. Carvalho
3b07689b6a serve: respect settings from .hg/hgrc
create_server was looking only at the root ui object, ignoring any
settings from .hg/hgrc.  To keep respecting command-line arguments,
commands.serve must also call repo.ui.setconfig.
2007-07-11 19:56:16 -03:00
Brendan Cully
4654693aa4 Add SSL support to hg serve, activated via --certificate option 2007-07-09 22:12:28 -07:00
Thomas Arendsen Hein
4d29c6dc8e Updated copyright notices and add "and others" to "hg version" 2007-06-19 08:51:34 +02:00
Thomas Arendsen Hein
483231d996 Cleanup of whitespace, indentation and line continuation. 2007-06-19 08:06:37 +02:00
Matt Mackall
934033161c hg serve: don't lookup user-supplied names/addresses 2007-06-10 19:16:20 -05:00
Thomas Arendsen Hein
49220695bc Removed trailing whitespace and tabs from python files 2007-06-06 20:22:52 +02:00
Matt Mackall
6f71aab47d Merge with stable 2007-04-26 18:41:18 -05:00
Matt Mackall
584e6c9643 hg serve: don't do DNS lookups 2007-04-25 13:35:18 -05:00
Alexis S. L. Carvalho
4bb1d039c5 Merge with crew-stable. 2007-03-19 19:16:35 -03:00
Alexis S. L. Carvalho
b2ef464fc4 avoid wsgiapplication <-> MercurialHTTPServer circular reference 2007-03-19 19:07:38 -03:00
Alexis S. L. Carvalho
93eb041452 Merge with crew-stable 2007-03-04 09:03:21 -03:00
Patrick Mezard
c887e90ae6 web/server: disable address reuse option for BaseHTTPServer on windows
On windows, a socket with the SO_REUSEADDR option set is able to bind to
any port, even if there's already an active socket listening on it.

test-http: check server address cannot be reused.
2007-02-19 10:08:59 +01:00
Alexis S. L. Carvalho
f3a8f26178 hgweb/server.py: use hg.repository to create a repo object 2007-02-15 08:49:20 -02:00
Alexis S. L. Carvalho
d4de823a64 merge with crew-stable 2007-02-16 05:27:37 -02:00
Alexis S. L. Carvalho
b169322734 Pass a ui from create_server to hgwebdir and a repo from hgwebdir to hgweb
This allows repo pages to respect hg serve --webdir-conf <file> --style=gitweb
(part of issue253).

Since we're creating a ui object anyway, use it as the parentui of the ui
objects created for every repo entry.  This has the unintended side-effect
that --name=foo on the command line will set the name of all repos.

If one of the repos being served has a .hg/hgrc owned by a user that is not
trusted, hg will now print the "Not trusting file..." warning when reading
it.  This is consistent with the behaviour from a hg serve from inside the
repo.
2007-02-13 10:01:44 -02:00
Alexis S. L. Carvalho
744364abd4 merge with crew-stable 2007-02-13 10:25:45 -02:00
Thomas Arendsen Hein
46055c07ca sync with -stable 2007-01-02 22:40:52 +01:00
Thomas Arendsen Hein
742fac2ea2 Handle exceptions in do_hgweb: Send "Internal Server Error", log traceback 2007-01-02 22:12:38 +01:00
Matt Mackall
f17a4e1934 Replace demandload with new demandimport 2006-12-13 13:27:09 -06:00
Brendan Cully
eed329d895 Fix hg serve -6 getsockname handling 2006-12-08 17:10:40 -08:00
Thomas Arendsen Hein
411d64ce3e white space and line break cleanups 2006-11-17 08:06:54 +01:00
Matt Mackall
d23c8e6356 hgweb: internalize some socket details 2006-11-13 13:26:57 -06:00