Commit Graph

575 Commits

Author SHA1 Message Date
Martin Geisler
a5dc911698 merge with mpm 2011-04-30 15:30:51 +02:00
Martin Geisler
e57b3a9f70 hgweb: initialize permhooks at definition time
This is simpler than creating it empty and then appending the default
checkauthz hook 50 lines below.
2011-04-30 13:47:22 +02:00
Alexander Solovyov
23228e2ea0 drop {short,hex}(ctx.node()) calls in favor of ctx methods 2011-04-30 12:55:07 +02:00
Alexander Solovyov
f4250e8e9c graphlog: make use of graphmod's revset support 2011-04-23 15:04:15 +02:00
Adrian Buehlmann
267c80394b move walkrepos from util to scmutil 2011-04-21 16:06:19 +02:00
Adrian Buehlmann
f3e8eae526 move canonpath from util to scmutil 2011-04-20 21:41:41 +02:00
Steven Stallion
6daa9da6c9 hgweb: support disabling page cache
By default, hgweb_mod supports caching via the ETag header. This can
cause some confusion with browsers which cache aggressively. This change
preserves existing behavior while giving the administrator a knob to
disable the ETag header.
2011-04-20 00:01:50 -04:00
Steven Stallion
239482dbab hgweb: support alternate logo url
Clicking on the logo image/text in the hgweb interface brings the
user to the Mercurial project page. The majority of users expect that
this would bring them to the top level index. I have added a new template
variable named `logourl' which allows an administrator to change this
behavior. To stay compatible with existing behavior, `logourl' will
default to http://mercurial.selenic.com/. This change is very useful in
large installations where jumping to the index is common.
2011-04-19 23:37:06 -04:00
Martin Geisler
5a3f4fec03 merge with stable 2011-04-19 15:19:54 +02:00
Martin Geisler
6cd55d2029 hgweb: detect change based on changelog size too
Before, there was a race between an access and a modification made
within the same second.
2011-04-19 15:15:56 +02:00
Md. O. Shayan
20e62c51a1 hgweb: set minimum number of revision to display to 1 when revcount is 0
When revcount goes to 0 nothing is displayed in hgweb. This patch sets revcount to max(revcount, 1).
2011-04-13 07:40:24 +05:30
Yuya Nishihara
109c433261 hgweb: add bookmarks listing to summary page of gitweb/monoblue styles 2011-04-10 10:01:42 +09:00
Yuya Nishihara
fe54e1ef28 hgweb: remove useless notip handling from bookmarks listing 2011-04-10 10:01:39 +09:00
Yuya Nishihara
723e882e64 hgweb: sort bookmarks in the same manner as console command 2011-04-10 10:01:37 +09:00
Md. O. Shayan
43492ff710 hgweb: fix inconsistant display of graphlog (issue1706) 2011-04-07 13:23:07 +05:30
Yuya Nishihara
95ce899cb1 hgweb: add bookmark labels to monoblue theme (based on 4d7cfa1867b5) 2011-03-30 02:22:15 +09:00
Martin Geisler
be192b7fa4 merge with stable 2011-04-07 11:40:54 +02:00
Brodie Rao
744f9e0914 hgweb: use url.url when setting CGI environment variables 2011-03-30 20:01:46 -07:00
Matt Mackall
1d9a1adcf9 merge with stable 2011-03-30 13:23:24 -05:00
timeless@gmail.com
a09c2a5533 hgwebdir: handle IOErrors from localrepo while enumerating
Repository() raises a number of IOErrors in addition to RepoErrors.
 these are just as uninteresting as RepoErrors and should be ignored

The easiest case of this is a repo whose .hg/ directory is -rx
2011-03-29 16:33:10 +00:00
Dirkjan Ochtman
43eea49bf4 hgweb: pmezard thinks one default is enough 2011-03-12 16:00:54 +01:00
Dirkjan Ochtman
d17590d4e7 deal with empty Content-Length headers 2011-03-12 15:21:45 +01:00
Alexander Solovyov
84912d6eaf hgweb: add separate page with bookmarks listing 2011-03-12 11:20:03 +01:00
Alexander Solovyov
e67bfa95ac hgweb: add display of bookmarks for changelog and changeset 2011-03-12 11:19:44 +01:00
Mads Kiilerich
53a7e81f78 hgweb: handle invalid requests with both form data and querystring
Invalid requests could give an unhandled ErrorResponse.

Now this ErrorResponse is handled like other ErrorResponses so the client gets
an error message which also is logged on the server.
2011-02-21 00:57:19 +01:00
Mads Kiilerich
4a3ec69835 hgweb: give ErrorResponse a descriptive string/Exception representation
Very handy if the exception should appear in output.
2011-02-21 00:52:26 +01:00
Mads Kiilerich
c77a84761e serve: catch and log all Exceptions, not only StandardException
Other exceptions than StandardExceptions were left to the default error handler
which was muted when running in daemon mode.

Now all Exceptions are handled and logged to the log file.
2011-02-21 00:52:23 +01:00
Wagner Bruna
44bdaed8cd hgwebdir: reduce memory usage for index generation
The archive list generator was holding a reference to each
temporary ui copy passed by rawentries(), so the memory
usage for index generation growed proportionally to the
ui object size and the amount of repositories. By returning a
list instead, the temporary reference is dropped immediately.
2011-02-17 18:05:27 -02:00
Mads Kiilerich
75f680564e hgweb: make paths wildcards expanding in a repo root match repo correctly
There was a trailing '/' too much when the wildcard part expanded to nothing.
The consequence was that the repo was announced but didn't work.
2011-02-15 01:04:10 +01:00
Mads Kiilerich
6e8efc0e0c hgweb: doctest of url creation from wildcard expansion 2011-02-15 01:04:10 +01:00
Dan Villiom Podlaski Christiansen
ec590d5cd4 explicitly close files
Add missing calls to close() to many places where files are
opened. Relying on reference counting to catch them soon-ish is not
portable and fails in environments with a proper GC, such as PyPy.
2010-12-24 15:23:01 +01:00
Matt Mackall
f6fde7c0c9 merge with stable 2010-12-29 15:31:25 -06:00
Matt Mackall
e6a9c922d9 hgweb: abort if config file isn't found 2010-12-29 15:23:16 -06:00
Oli Thissen
19beab3bf6 hgweb: added revision date to annotate line data
The only revision information yielded by the annotate view was the revision
number itself. The patch allows the use of per-line revision dates in the
corresponding templates.
2010-12-06 16:56:06 +01:00
Wagner Bruna
e391a0d422 hgwebdir: fix incorrect index generation for invalid paths (issue2023)
8aa8db6deb47 moved the subdirectory match inside the repository match
loop. A virtual path existing/path/invalid/path would then match
existing/path, and generate a wrong index page.
2010-11-30 12:45:25 -02:00
Mads Kiilerich
edd19f159b hgweb: let HTTPS serve use more compatible and less secure encryption
PROTOCOL_SSLv3 on the server side doesn't work everywhere. Sometimes the client
reports "EOF occurred in violation of protocol" (for example on Mac and Solaris).

The more compatible PROTOCOL_SSLv23 is now used instead. It works but is less
"secure" for some OpenSSL versions as it can fall back to weak encryption.
2010-10-21 03:18:52 +02:00
Mads Kiilerich
affe4fdcad hgweb: use Pythons ssl module for HTTPS serve when using Python 2.6 or later
pyOpenSSL apparently doesn't work for Python 2.7 and isn't very actively
maintained.

The built-in ssl module seems like a long-term winner, so we now use that with
Python 2.6 and higher.
2010-10-20 20:19:34 +02:00
Mads Kiilerich
1edb529392 hgweb: refactor all pyOpenSSL references into one class 2010-10-20 20:19:32 +02:00
Mads Kiilerich
c627f511ce serve: fix https mode and add test
The https mode failed in super because BaseRequestHandler is an old-style
class.

This introduces the first test of https client/server functionality - and
"hghave ssl". The test is currently only run on Python 2.6.
2010-10-17 04:13:35 +02:00
Augie Fackler
4ec8b25214 hgweb: don't send a body or illegal headers during 304 response
Without this fix, mod_wsgi and spawning get in a wedged state after
sending a 304 response. Not sending a body fixed that problem. The
header change was discovered by using wsgiref.validate.validator to
check for other errors.
2010-10-16 17:29:04 -05:00
Benoit Boissinot
9bd037b429 wireproto/http: drain the incoming bundle in case of errors 2010-10-11 12:47:11 -05:00
Benoit Boissinot
16e11c728a wireproto: introduce pusherr() to deal with "unsynced changes" error
The behaviour between http and ssh still differ:
- the "unsynced changes" is seen as a remote output in the http cases
- but it is correctly seen as a push error for ssh
2010-10-11 12:45:36 -05:00
Matt Mackall
60aea94981 hgweb: another fix for the help termwidth bug 2010-10-10 17:35:28 -05:00
Matt Mackall
d12e3634d3 hgweb: more ui fiddling 2010-10-10 11:05:06 -05:00
Augie Fackler
8969884a91 hgweb: fix hgweb_mod as well as hgwebdir_mod 2010-10-10 10:42:44 -05:00
Augie Fackler
dd4bc6e0c2 hgwebdir_mod: use fake termwidth to avoid mod_wsgi's wrath 2010-10-10 10:07:17 -05:00
Augie Fackler
1978da6b24 web: add a help view for getting hg help output 2010-10-09 12:27:14 -05:00
Matt Mackall
e06b83d527 merge with stable 2010-09-27 10:48:50 -05:00
Ry4an Brase
87ae742f5e Correct Content-Type header values for archive downloads.
The content type for both .tar.gz and .tar.bz2 downloads was
application/x-tar, which is correct for .tar files when no
Content-Encoding is present, but is not correct for .tar.gz and .tar.bz2
files unless Content-Encoding is set to gzip or x-bzip2, respectively.

However, setting Content-Encoding causes browsers to undo that encoding
during download, when a .gz or .bz2 file is usually the desired
artifact.  Omitting the Content-Encoding header is preferred to avoid
having browsers uncompress non-render-able files.

Additionally, the Content-Disposition line indicates a final desired
filename with .tar.gz or .tar.bz2 extension which makes providing a
Content-Encoding header inappropriate.

With the current configuration browsers (Chrome and Firefox thus far)
are registering the application/x-tar Content-Type and not .tar
extension and appending that extension, yielding filename.tar.gz.tar as
a final on-disk artifact.  This was originally reported here:
http://stackoverflow.com/questions/3753659

I've changed the .tar.gz and .tar.bz2 Content-Type values to
application/x-gzip and application/x-bzip2, respectively.  Which yields
correctly named download artifacts on Firefox, Chrome, and IE.
2010-09-20 14:56:08 -05:00
Dirkjan Ochtman
fcd515c23a hgweb: support very simple caching model (issue1845) 2010-09-08 15:23:48 +02:00