Commit Graph

452 Commits

Author SHA1 Message Date
Dirkjan Ochtman
67493fd86d Merge from crew-stable. 2008-04-03 13:21:42 +02:00
Matt Mackall
cf71bb5f2b hgweb: fix merge breakage 2008-03-31 23:14:25 -05:00
Matt Mackall
1cca88367c hgweb: minor improvements for new web style
- make renamelink take a context
- pass current node to shortlog page rather than tip
- pass user/desc/date/rename to filediff
- improve template error reporting for foo%bar
2008-03-31 21:49:33 -05:00
Benoit Boissinot
2a79bac3c3 fix bug introduced by 3036384ac63a (thanks pychecker) 2008-03-30 22:29:02 +02:00
Benoit Boissinot
574729489c fix bug introduced by 4858a155c4aa (short not defined) 2008-03-30 22:22:53 +02:00
Benoit Boissinot
f193be73bd hgweb: remove dead code 2008-03-29 21:15:34 +01:00
Dirkjan Ochtman
ef391be22f hgweb: refactor hgweb code 2008-03-28 19:40:44 +01:00
Dirkjan Ochtman
9c32b06e9a hgweb: separate out utility functions 2008-03-28 19:37:28 +01:00
Dirkjan Ochtman
9731167667 Backed out changeset a3eeb13e3d5c (temporary template compatibility) 2008-03-24 18:18:39 +01:00
Alexis S. L. Carvalho
506e114776 hgweb: add compatibility code for old templates
Up to changeset 6713db859c82, HTTP headers were expected to be embedded
in the "headers" template.  Since that changeset, the content-type is
supposed to be defined as the "mimetype" template in the map file.

This changeset makes sure the old templates still work.
2008-03-24 13:45:01 -03:00
Dirkjan Ochtman
bddf3af283 hgweb: fix breakage in python < 2.5 introduced in 664786dcb24f 2008-03-24 16:20:15 +01:00
Dirkjan Ochtman
056bb10b17 hgweb: better error messages 2008-03-23 23:08:18 +01:00
Dirkjan Ochtman
d049a05886 hgweb: only accept POST requests for unbundle 2008-03-21 00:55:53 +01:00
Thomas Arendsen Hein
8064adc9b8 Spacing cleanup 2008-03-16 23:24:53 +01:00
Eric Hopper
0a50218866 Allow hgwebdir collections to follow symlinks. 2008-03-15 12:42:34 -07:00
Jesse Glick
40263dc4dd Issue937: error messages from hooks not sent over HTTP.
Turns out that stderr - where ui.warn would send messages - was not
being proxied over the HTTP connection. stdout was, and it seems you
need both. (The streams are interleaved for readability.)

Tested on Ubuntu 7.10 with lighttpd on hgweb.cgi with HTTP Basic auth,
no SSL, using a changeset failing win32text.forbidcrlf.
2008-02-25 09:55:57 -05: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
Florent Guillaume
c1858ea074 hgweb_mod: add branch helper functions to use in templates 2008-03-13 23:45:35 +01:00
Brendan Cully
e1863ee903 Support web.baseurl in hgwebdir, overriding SCRIPT_NAME 2008-03-08 17:19:18 -08: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
Joel Rosdahl
5dae3059a0 Expand import * to allow Pyflakes to find problems 2008-03-06 22:23:26 +01:00
Thomas Arendsen Hein
deb94bc7fe Removed trailing spaces from everything except test output 2008-03-07 00:24:36 +01:00
Thomas Arendsen Hein
cc608e0715 hgweb/annotate: handle binary files like hgweb/file 2008-03-02 23:32:13 +01:00
Dirkjan Ochtman
b1672f1ac2 hgweb: fix parameter mixup (issue1001) 2008-02-23 11:19:59 +01:00
Dirkjan Ochtman
9710ce5ef6 hgweb: no i18n in protocol responses 2008-02-21 15:56:35 +01:00
Dirkjan Ochtman
44000fbf43 improve changegroup.readbundle(), use it in hgweb 2008-02-21 17:02:28 +01:00
Dirkjan Ochtman
cdb32d9cc8 hgweb: use bundletypes from mercurial.changegroup 2008-02-21 15:00:25 +01:00
Dirkjan Ochtman
be3fb00c67 hgweb: separate protocol calls from interface calls (issue996)
The protocol functions are already pretty careful about not raising
exceptions to the caller, and have their own error handling. We can formalize
this a little bit to make it clearer (before, the exception handlers for
a limited number of exceptions coming from the interface bits would blow up
because some variables aren't instantiated for the protocol calls).
2008-02-20 10:50:10 +01:00
Thomas Arendsen Hein
6f399a19b1 merge backout 2008-02-18 19:21:33 +01:00
Thomas Arendsen Hein
4d33c02751 Backed out changeset 8105fa3c7347 (see issue971/msg5317) 2008-02-18 19:20:22 +01:00
Bryan O'Sullivan
dfa3e1ea9b profiling: allow CGI and FastCGI to be profiled 2008-02-01 13:09:45 -08:00
Dirkjan Ochtman
3d668210f2 hgweb: explicit response status 2008-02-01 10:31:13 +01:00
Matt Mackall
41e5c79455 templates: move filters to their own module
This eliminates just about all Mercurial dependencies in templater.py
2008-01-31 14:44:19 -06:00
Michele Cella
095d8aff18 hgweb: fixes to make hg serve prefix handling more robust 2008-01-22 22:13:29 +01:00
Dirkjan Ochtman
cbeaa77a15 hgweb: forgot to centralize the req.write() calls in hgwebdir 2008-01-28 16:35:02 +01:00
Dirkjan Ochtman
8ee250977c hgweb: centralize req.write() calls 2008-01-28 15:10:17 +01:00
Dirkjan Ochtman
3b49a144eb hgweb: explicitly check if requested command exists 2008-01-28 14:58:03 +01:00
Dirkjan Ochtman
6bc7bb23af hgweb: get rid of raw-related code in hgweb.filerevision() 2008-01-28 13:42:40 +01:00
Patrick Mezard
1c23ba81a1 webcommands: add missing hg import 2008-01-26 22:44:27 +01:00
Dirkjan Ochtman
4ea6b6bcae send conservatively capitalized HTTP headers 2008-01-23 14:28:25 +01:00
Dirkjan Ochtman
702f1f50b2 hgweb: move HTTP content types out of header templates
This removes the ability for templates to add custom HTTP headers, which can
easily be re-added if someone needs it. Thanks to asak for repeatedly reviewing
this patch and helping to iron out the quirks.
2008-01-22 10:45:55 +01:00
Dirkjan Ochtman
a51e4d434d hgweb: revert to showing file instead of offering for download 2008-01-22 10:45:52 +01:00
Dirkjan Ochtman
54cd7309f5 hgweb: be sure to send a valid content-type for raw files 2008-01-22 12:31:55 +01:00
Dirkjan Ochtman
83100b06d2 hgweb: use ErrorResponse instead of custom response 2008-01-22 09:28:51 +01:00
Dirkjan Ochtman
f4b035d012 hgweb: fix a stupid KeyError introduced in 109699000009
Thanks to Christian Ebert for finding this. Also added a test to prevent this
from happening again.
2008-01-22 09:11:08 +01:00
Dirkjan Ochtman
0b45850058 hgweb: cleanup buglet introduced in 7ec4fd3d8731 2008-01-22 09:11:06 +01:00
Christian Ebert
5c18a69d2e Prefer i in d over d.has_key(i) 2008-01-20 14:39:25 +01:00
Dirkjan Ochtman
4de316f884 hgweb: fast path for sending raw files 2008-01-18 19:53:38 +01:00
Dirkjan Ochtman
a854166262 hgweb: just return iterables instead of yielding them 2008-01-18 19:53:38 +01:00
Dirkjan Ochtman
e43716d86a hgweb: separate out start_response() calling 2008-01-18 19:53:38 +01:00
Dirkjan Ochtman
54b4ea87f1 hgweb: return iterable, add deprecation note 2008-01-18 19:53:38 +01:00
Dirkjan Ochtman
0d71615663 hgweb: remove some legacy code 2008-01-18 19:53:38 +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
Matt Mackall
f277b2676b hook: redirect stdout to stderr for ssh and http servers 2008-01-11 13:06:38 -06:00
Thomas Arendsen Hein
1566cda979 Don't let ui.username override web.contact (issue900)
63beab327d26 introduced using ui.username before web.contact, but this was
never documented and might cause commit accidents.

- Drop web.author (deprecated since 2005)
- Try ui.username or $EMAIL as a fallback to display something useful.
- Update docs for the fallbacks.
2008-01-01 17:07:15 +01:00
Thomas Arendsen Hein
347da85c36 Removed tabs and trailing whitespace in python files 2007-12-29 19:49:48 +01:00
Mirko Friedenhagen
2a87bfec34 server: append to logfiles 2007-12-24 17:21:40 +01:00
Dirkjan Ochtman
e267ed3e21 hgwebdir: refactor inner loop 2007-12-03 19:19:12 +01:00
Dirkjan Ochtman
342d039d4e hgwebdir: split out templater creation 2007-12-03 18:58:18 +01:00
Dirkjan Ochtman
5cda3f99f4 hgwebdir: split out makeindex function, facilitate test failure diagnosis 2007-12-03 18:40:37 +01:00
Dirkjan Ochtman
2365373281 hgweb: explicitly pass around the templater 2007-12-03 13:30:08 +01:00
Dirkjan Ochtman
031b079856 hgweb: split out templater definition 2007-12-03 12:40:29 +01:00
Dirkjan Ochtman
e2b08400db separate the wire protocol commands from the user interface commands 2007-12-03 12:27:11 +01:00
Dirkjan Ochtman
8169e83987 hgweb: extract constant to global level 2007-12-03 12:06:21 +01:00
Dirkjan Ochtman
4391298487 hgweb: get rid of some nested functions 2007-12-03 11:58:52 +01:00
Dirkjan Ochtman
b14cdb9ce4 fix some imports; pushing bz2 bundles over http is currently untested 2007-12-03 11:58:29 +01:00
Dirkjan Ochtman
58139af39c split out hgweb commands into a separate file, move some code around 2007-12-02 23:26:40 +01:00
Patrick Mezard
65e701f1ae Merge with crew-stable 2007-12-02 19:45:38 +01:00
Patrick Mezard
9421498212 hgwebdir: normalize virtual paths before stripping the separator
It is not even clear that virtual paths should be normalized as normal paths at all, we could expect slash to be the natural separator.
2007-12-02 19:39:27 +01:00
Dirkjan Ochtman
857b34f4d7 Fix style nit and add some comments to tests. 2007-12-02 10:12:26 +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
9851dc942e CGI compatibility fix for 77bd163fb48d. 2007-12-01 18:26:27 +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
Bryan O'Sullivan
4fa397a600 Drop a bad import that snuck in. 2007-11-28 13:58:31 -08:00
Bryan O'Sullivan
9ae1a2c354 hgweb: fix breaking tests on Python < 2.5 2007-11-28 09:39:17 -08:00
Bryan O'Sullivan
acbe5bb17e Merge with crew 2007-11-28 08:39:05 -08:00
Bryan O'Sullivan
e19dabc11f hgweb: return meaningful HTTP status codes instead of nonsense 2007-11-28 08:38:42 -08:00
Patrick Mezard
7d72f53113 hgweb.server: flush log files after every access 2007-11-27 23:55:03 +01:00
Rocco Rutte
49a794484a hgweb_mod: update unidiff() calls and finish f2af74bd8f86 job 2007-11-03 17:04:42 +01:00
Thomas Arendsen Hein
b04d324f97 hgweb: Quote filenames when downloading raw files. 2008-02-16 18:12:30 +01:00
Thomas Arendsen Hein
a285a14d02 hgweb: Pass only filename instead of full path when downloading raw files.
Before this patch "filename=foo/bar" was sent and e.g. Firefox offered to save
the file as "foo-bar" instead of just "bar".
2008-02-16 17:51:30 +01:00
Thomas Arendsen Hein
1b84b0de7c Make hgweb annotate link to target line numbers (issue623) 2008-02-15 21:34:16 +01:00
Thomas Arendsen Hein
ad12af151f merged Edward Lee's line anchors patch 2008-02-15 19:44:54 +01:00
Edward Lee
9f8402d3c0 Add line anchors to annotate, changeset, diff, file views for hgweb 2007-09-04 22:25:37 -05:00
Michele Cella
d5755b1f51 fix to let test-hgwebdir pass
fixes a regression introduced in changeset 3c6008c8685a
2008-02-08 15:42:28 +01:00
Thomas Arendsen Hein
1d27b34424 merge with crew-stable 2008-02-05 14:34:46 +01:00
Dirkjan Ochtman
8f3b12c02f hgweb: fix search skipping tip 2008-02-05 14:02:03 +01:00
Alexis S. L. Carvalho
ddf41e005d Merge with crew-stable 2007-09-24 19:14:18 -03:00
Alexis S. L. Carvalho
6cc4435607 hgwebdir: ignore hgrc parse errors while building the index page
An error in the .hg/hgrc file from a repository would prevent the
following repos from being shown in the index page.

The IOError handling was unnecessary - it's already handled in
readconfig.

This should fix issue731.

The error in the .hg/hgrc file will still prevent the repo from
being exported with hgweb.
2007-09-24 19:00:11 -03:00
Alexis S. L. Carvalho
e23adec251 hgweb: don't raise an exception when displying empty repos
The nullid node claims it's in the default branch, but the branch dict
is empty.  This fixes the main symptom from issue696, but we may want
to set branchtags()['default'] = nullid somewhere for empty repos.
2007-09-24 19:00:11 -03:00
Thomas Arendsen Hein
128a411ed1 merge with crew-stable 2007-09-07 17:54:38 +02:00
Dirkjan Ochtman
a80e1eb528 Prevent WSGI apps from touching sys.stdin by setting ui.interactive to False. 2007-09-07 17:38:52 +02:00
Thomas Arendsen Hein
23916758e6 hgweb: Show date of last change for each file in manifest 2007-08-31 11:18:29 +02:00
Robert Bachmann
ecb337b8cb Added support for the Atom syndication format 2007-08-30 16:42:17 +02:00
Thomas Arendsen Hein
90d76a6ec9 Enable demandimport only in scripts, not in importable modules (issue605)
This way other applications can choose if and when they want this feature,
because it might be problematic if those applications rely on ImportError.
2007-08-18 11:37:08 +02: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
Alexis S. L. Carvalho
9107d93d2f merge with crew-stable 2007-08-06 01:00:10 -03:00
Alexis S. L. Carvalho
ed3d96430e hgweb: don't use os.path.join to build URL parts 2007-08-05 22:36:39 -03:00
Alexis S. L. Carvalho
cba13b82f6 hgwebdir: change os.sep in the name of repos to "/" 2007-08-05 22:36:39 -03:00
Matt Mackall
cd72dc7f1b Merge with crew 2007-07-21 16:44:38 -05:00
Matt Mackall
3e13c68628 Use try/finally pattern to cleanup locks and transactions 2007-07-21 16:02:10 -05:00
Thomas Arendsen Hein
d9d3256252 removed trailing whitespace 2007-07-21 10:30:51 +02: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
Christian Ebert
7a47878736 Use isinstance instead of type == type 2007-07-06 12:02:43 +02:00
Wesley J. Landaker
49f06e37cf Use wsgi.url_scheme instead of ad-hoc CGI checks.
Instead of each place in hgweb_mod that needs to check for SSL or get
the protocol scheme (http vs. https) doing it ad-hoc, make them just
look at the wsgi.url_scheme which because of previous patches is now
always set correctly.
2007-07-12 22:55:44 -07: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
Wesley J. Landaker
feb6c32251 Handle CGI SSL detection via HTTPS environment better.
Some servers send on/off, 0/1, yes/no, and may be upper or lower case.
This fix will handle all of those permutations. It was inspired by the
detection done in in some other wsgi python web applications I looked at.
2007-07-12 13:55:20 -06:00
Alexis S. L. Carvalho
05dd580e30 merge with crew-stable 2007-07-11 20:15:03 -03:00
Wesley J. Landaker
034dcaed92 Make {urlbase} work in templates when https is used. 2007-07-10 10:54:54 -06:00
Brendan Cully
4654693aa4 Add SSL support to hg serve, activated via --certificate option 2007-07-09 22:12:28 -07:00
Brendan Cully
d2d845d908 hgwebdir: check for repo foo before browsing subdirectories of foo/ 2007-07-07 21:55:56 -07:00
Brendan Cully
5d30097ec4 hgweb: browse subdirectories before checking whether parent directory is also a repository 2007-07-07 15:09:08 -07:00
Brendan Cully
4750025032 Last change broke new-style URLs 2007-07-06 10:11:48 -07:00
Brendan Cully
d31b7d1fa4 hgwebdir: do not walk up the given path looking for a repository. It is there or it isn't. 2007-07-06 09:15:17 -07:00
Brendan Cully
2216ff4225 hgwebdir: show only trailing part of path when browsing subdirectories 2007-07-05 19:56:16 -07:00
Brendan Cully
10f4d33bdf hgweb: let hgwebdir browse subdirectories 2007-07-05 19:44:06 -07:00
Alexis S. L. Carvalho
f9b8c79d22 hgweb: use lrwxrwxrwx as the permissions of a symlink 2007-07-03 03:06:40 -03:00
Markus F.X.J. Oberhumer
974b7c5201 Add option "hidden" to hgwebdir.
TODO: should this option be renamed to 'hide_from_index' or
maybe to 'index_ignore' (like Apache's mod_autoindex) ?
2007-06-25 14:46:20 +02:00
OHASHI Hideya
83f32e7ff9 Enable to select encoding in hgrc web section
This patch provides character encoding setting in each repository. After this
patch, You can use multi encoding repositories with one mercurial server.
2007-06-13 18:18:06 +09:00
Thomas Arendsen Hein
1b20c30e25 hgweb_mod.archive(): Use 'key' instead of builtin 'id'. 2007-06-21 19:38:44 +02: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
Brendan Cully
73b9a0fd82 Small cleanups for the new tag code 2007-06-11 11:06:42 -07:00
Josef "Jeff" Sipek
066eaf6a84 gitweb: Display branch and tag labels
Pages which display labels:
- summary
- shortlog
- changelog
- changeset
- search
2007-06-01 19:56:39 -04: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
Alexis S. L. Carvalho
ae21f631dc merge with crew-stable 2007-06-04 00:26:53 -03:00
Alexis S. L. Carvalho
0e52789888 wsgicgi: change stdin to binary mode 2007-06-04 00:24:48 -03:00
Josef "Jeff" Sipek
77b18ca042 gitweb: Fixed-up search template
It seems that the search template has been forgoten over time, and needed
major revamping.
2007-05-31 20:12:40 -04:00
Thomas Arendsen Hein
3005b8655d hgweb: use generator to count parity of horizontal stripes for easier reading.
- use web.stripes in all places and consistently
- start with parity0 for lists generated in reverse (e.g. changelog)
2007-05-29 16:42:05 +02:00
Josef "Jeff" Sipek
0e1bc7bd9a hgweb: manifest: pass parity for the '[up]' link 2007-05-29 05:08:01 -04:00
Edouard Gomez
52552f6c05 Fix inconsistency for the stream_out capability in hgweb
During some experiments of mine, the uncompressed cloning could not
be enabled for hgweb.cgi nor hgwebdir.cgi though the server claimed
to be stream_out capable.

The only solution was to enable it using the user's .hgrc file.
This solution is not acceptable when publishing the repos through
an HTTP server because the CGI runs as a www dedicated user whose's
home hgrc file may not be accessible to users publishing their repos
through their userdir.

For such cases we could end up with this typical debug output:
hg --debug clone --uncompressed http://server/hg/project
destination directory: project
sending capabilities command
capabilities: lookup changegroupsubset stream=1
unbundle=HG10GZ,HG10BZ,HG10UN
sending stream_out command
abort: operation forbidden by server

The error lies in the fact the hgweb object defines new accessors
to the repo configuration that trust things by default (untrusted=True)
but the streamclone:stream_out function uses the usual accessors to the
repo.ui object, which do not trust by default (untrusted=False)

Fix this inconsistency, adding a new parameter to the stream_out function.
hgweb then forces a "trust by default" behavior.
2007-05-12 00:41:30 +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
Matt Mackall
765aba6082 Merge with stable 2007-04-16 09:52:37 -05:00
Matt Mackall
8392cf0d15 hgweb: fix rfind bug in PATH_INFO handling 2007-04-16 09:51:50 -05:00
Matt Mackall
bc0f074639 Merge with stable 2007-04-15 18:42:38 -05:00
Matt Mackall
65b380693b hgweb: make PATH_INFO handling slightly more robust 2007-04-12 11:00:21 -05:00
Alexis S. L. Carvalho
047c4b002b Merge with crew-stable. 2007-04-07 04:45:27 -03:00
TK Soh
bdd80aea95 hgweb: expand keyword search to full list of files 2007-03-29 09:32:59 -05:00
Alexis S. L. Carvalho
3082154fa5 avoid _wsgioutputfile <-> _wsgirequest circular reference
We use the _wsgirequest object itself as the output file object.

To avoid a "self.out = self" which would create another circular
reference, we make the "out" attribute a trivial property.
2007-03-19 19:07:39 -03:00
Alexis S. L. Carvalho
b2ef464fc4 avoid wsgiapplication <-> MercurialHTTPServer circular reference 2007-03-19 19:07:38 -03:00
Alexis S. L. Carvalho
69ecc6b336 hgwebdir: break templater -> templater circular reference
This is essentially another instance of the same problem fixed
by the parent changeset.  See its commit message for the details.
2007-03-19 19:07:37 -03:00
Alexis S. L. Carvalho
8bb9d231ee hgweb: break templater -> templater circular reference
The problem were some functions passed in the "defaults" argument
during the templater creation which use "self.t" directly.  This
creates the cycle:

 hgweb object
  -> templater object
      -> defaults dict
          -> footer function
              -> hgweb object

Instead of completely avoding the cycle, we break it after using
the templater.
2007-03-19 19:07:35 -03:00
Alexis S. L. Carvalho
2b2a1a8a86 hgweb: handle IOErrors and OSErrors during unbundle
This allows the client to display a reasonable message to the user
(e.g. "Permission denied: .hg/lock"), instead of the current
"<url> does not appear to be an hg repository".
2007-03-16 00:22:55 -03:00
Alexis S. L. Carvalho
d6886d1abf hgweb: don't display heads in gitweb-style summary page 2007-03-27 01:41:25 -03:00
greg@maptuit.com
889f908913 hgweb: display named branches in gitweb-style summary page 2007-03-16 17:55:42 -04:00
Christian Ebert
e4369b6da3 hgweb: short hash for tip archive name 2007-03-13 13:17:26 +01:00
Matt Mackall
04561e556e revlog: simplify revlog version handling
- pass the default version as an attribute on the opener
- eliminate config option mess
2007-03-22 19:52:38 -05:00
Alexis S. L. Carvalho
4bb1d039c5 Merge with crew-stable. 2007-03-19 19:16:35 -03:00
Alexis S. L. Carvalho
47cb22b5a2 Merge with crew-stable 2007-03-16 00:45:18 -03:00
Michael Gebetsroither
1a5dd99e58 hgweb: use the given revision in the name of the archive
If you ask for an archive in hgweb by tagname the directory in the archive
should include the tagname not the changeset-id.
2007-03-08 22:36:12 +01: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
110602f186 hgweb: catch util.Abort raised by addchangegroup
Right now, if a pretxnchangegroup hook fails, we send some HTML
error message to the client and the transaction is not rolled back
(issue499).

Catching util.Abort allows us to send a decent message to the client
and for some reason makes the rollback complete.

This patch is not perfect since it doesn't fix the reason why the
transaction wasn't rolled back (maybe some circular references?).
Also, the transaction is aborted only after we've sent the response
back to the client and the "transaction aborted" message ends up in
the logs of the web server.
2007-02-16 05:10:43 -02: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
b95f1add5a hgweb: allow static files to be served directly by the HTTP server 2007-02-15 08:51:32 -02:00
Alexis S. L. Carvalho
5334342412 hgwebdir: try to get web.style and web.motd from the ui.config system
This finishes fixing issue253.  As a bonus, web.style and web.motd
settings from ~/.hgrc will be used for the hgwebdir index page.
2007-02-13 10:02:07 -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
Alexis S. L. Carvalho
9d682f1c81 Switch CGI stdout to binary on windows
Problem diagnosed by Andrei Vermel.
2007-02-13 06:50:00 -02:00
Michael Gebetsroither
ca10271bf3 hgwebdir: class hgwebdir should also accept a configparser instance 2007-01-30 22:07:22 +01:00
Alexis S. L. Carvalho
678568081f Don't use ints in HTTP headers 2007-01-18 22:16:26 -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
Benoit Boissinot
e0f69e934d hgweb: fix unused import 2006-12-26 03:17:34 +01:00
Benoit Boissinot
49c4016ea6 hgweb: use contexts, fix coding style 2006-12-26 03:16:54 +01:00
Benoit Boissinot
cd66ae056f remove various unused import 2006-12-25 13:37:00 +01:00
Brendan Cully
828c5b99b4 Teach hgweb about revlog.LookupError 2006-12-19 16:40:09 -08:00
Brendan Cully
19123a0330 Merge with main 2006-12-14 13:49:33 -08:00
Thomas Arendsen Hein
bf61bfecec Set charset encoding for hgwebdir, too.
(And remove extra spaces in the corresponding place in hgweb)
2006-12-14 16:07:29 +01:00
Matt Mackall
f17a4e1934 Replace demandload with new demandimport 2006-12-13 13:27:09 -06:00
Matt Mackall
6d9bbc8702 Merge Benoit's .hg/store support 2006-12-10 02:11:02 -06:00
Brendan Cully
eed329d895 Fix hg serve -6 getsockname handling 2006-12-08 17:10:40 -08:00
Benoit Boissinot
e005ffc8c4 switch to the .hg/store layout, fix the tests 2006-12-01 13:34:09 +01:00
Matt Mackall
cdbe57fc80 hgweb: report detected character set
Add comments on overriding charset to CGI scripts
2006-12-03 18:47:05 -06: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
Thomas Arendsen Hein
944124b40d Add allowed bundle types as argument to hgweb unbundle capability.
Arguments to capabilities were added before the 0.9.1 release, so there
are no compatibility issues. Mercurial 0.9 didn't support http push.

Using HG10GZ, HG10BZ and HG10UN has the advantage that new bundle types can
be added later and the client doesn't have to try sending them first and
reacting on errors sent by the server.
2006-11-02 14:39:08 +01:00
Alexis S. L. Carvalho
444ab6d2a3 hgweb: remove debugging print 2006-11-01 19:59:26 -03:00
Benoit Boissinot
b15071fd87 hgweb: introduce a new capability for sending a compressed bundle
the header of the bundle is the same as a on-disk bundle
HG10UN: uncompressed
HG10BZ: bz2
HG10GZ: gzip
no header means uncompressed (old client)
2006-11-01 22:06:24 +01:00
Brendan Cully
5f6282dd1c hgweb: split URLs containing spaces or other escaped characters correctly 2006-10-31 18:10:23 -08:00
Benoit Boissinot
0465719da8 hgweb: fix handling of path for old style template
- path from old style are prefixed by '/', make cleanpath strip them
- make manifest() use relative paths, that was the only function using
  '/' prefixed paths
2006-10-31 13:09:43 +01:00
Thomas Arendsen Hein
f26c110d43 Turn of "Not trusting file" logging when running hgweb and hgwebdir
(hg serve still shows the warning)
2006-10-26 19:25:45 +02:00
Alexis S. L. Carvalho
a28f2ec0e2 use untrusted settings in hgwebdir 2006-10-26 19:25:45 +02:00
Alexis S. L. Carvalho
0f80467c85 use untrusted settings in hgweb
The only exceptions are web.static and web.templates, since they can
be used to get any file that is readable by the user running the CGI
script.

Other options can be (ab)used to increase the use of the cpu
(allow_bz2) or of the bandwidth (server.uncompressed), but they're
trusted anyway.
2006-10-26 19:25:45 +02:00
Brendan Cully
13601730e7 hgweb: add heads to gitweb summary 2006-10-24 13:31:01 -07:00
Alexis S. L. Carvalho
5d26c882ab hgweb: make #motd# available for all templates 2006-10-22 21:47:37 -03:00
Alexis S. L. Carvalho
8d63449217 hgweb.unbundle: call req.httphdr only after the last possible call to bail 2006-10-22 13:54:43 -03:00
Thomas Arendsen Hein
a686645595 Fix "templater object got multiple values for keyword argument 'motd'"
caused by adding motd to the call to the index template (dcb6e0ff8606)
2006-10-21 20:51:24 +02:00
Thomas Arendsen Hein
b6713ee084 Add #motd# to gitweb pages. Needs to pass self.motd to index template, too. 2006-10-21 20:19:46 +02:00
Benoit Boissinot
3f09dfef56 use xrange instead of range 2006-10-19 14:16:51 +02: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