Commit Graph

266 Commits

Author SHA1 Message Date
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
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
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
Matt Mackall
60aea94981 hgweb: another fix for the help termwidth bug 2010-10-10 17:35:28 -05:00
Augie Fackler
8969884a91 hgweb: fix hgweb_mod as well as hgwebdir_mod 2010-10-10 10:42:44 -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
Brodie Rao
203cf2fbd9 cleanup: remove unused imports 2010-08-27 13:32:38 -04:00
Peter Arrenbrecht
6646f48826 wireproto: add getbundle() function
getbundle(common, heads) -> bundle

Returns the changegroup for all ancestors of heads which are not ancestors of common. For both
sets, the heads are included in the set.

Intended to eventually supercede changegroupsubset and changegroup. Uses heads of common region
to exclude unwanted changesets instead of bases of desired region, which is more useful and
easier to implement.

Designed to be extensible with new optional arguments (which will have to be guarded by
corresponding capabilities).
2011-03-23 16:02:11 +01:00
Augie Fackler
01f4abe03c hgweb_mod: respond right away if the client specified 100-continue support
Clients that send 100-continue should make sure they really support
continue intelligently. In a later patch we'll introduce a capability so
new clients don't pay a performance penalty talking to old servers.
2011-01-07 15:19:21 -06:00
Matt Mackall
20113ea93e protocol: move hgweb protocol support back into protocol.py
- introduce iscmd
- simplify error handling
- remove unneeded imports
2010-07-15 15:05:04 -05:00
Matt Mackall
a6024ca63a protocol: unify unbundle on the server side 2010-07-15 11:24:42 -05:00
Matt Mackall
47c6d08427 protocol: unify stream_out command 2010-07-14 16:19:27 -05:00
Matt Mackall
050367f581 protocol: unify changegroup commands
- add sendchangegroup protocol helpers
- handle commands with None results
- move changegroup commands into wireproto.py
2010-07-14 15:43:20 -05:00
Matt Mackall
24246d7bcf protocol: use new wireproto infrastructure in ssh
- add protocol helper
- insert wireproto into dispatcher
- drop duplicate functions from hgweb implementation
2010-07-14 15:25:15 -05:00
Matt Mackall
d8e0a2188b pushkey: add http support
pushkey requires the same permissions as push
listitems requires the same permissions as pull
2010-06-16 16:05:19 -05:00
Matt Mackall
5712bac3b8 hgweb: always clear report_untrusted and interactive 2010-04-26 11:03:40 -05:00
Matt Mackall
d803a5b601 hgweb: add baseui to hgweb entrypoint 2010-04-26 11:03:40 -05:00
Nicolas Dumazet
7f1a963829 pylint, pyflakes: remove unused or duplicate imports 2010-04-14 17:58:10 +09:00
Matt Mackall
8d99be19f0 many, many trivial check-code fixups 2010-01-25 00:05:27 -06:00
Matt Mackall
cd3ef170f7 Merge with stable 2010-01-19 22:45:09 -06:00
Matt Mackall
595d66f424 Update license to GPLv2+ 2010-01-19 22:20:08 -06:00
Dirkjan Ochtman
c93b170e46 hgweb: don't choke when an inexistent style is requested (issue1901) 2009-11-12 16:39:11 +01:00
Dirkjan Ochtman
0032b55ff7 hgweb: treat rev as raw-rev if user agent is hg 2009-11-06 22:46:46 +01:00
Benoit Boissinot
a082a7dc75 hgweb: deny cloning a subpath of a repo 2009-06-20 16:42:51 -05:00
Matt Mackall
067d110f29 hgweb: web.encoding should override encoding.encoding (issue1183) 2009-06-20 13:00:25 -05:00
Martin Geisler
3f7c86dc69 wrap string literals in error messages 2009-05-31 01:30:16 +02:00
Brendan Cully
5779dfb1e0 hgweb: Make get_mtime use repository to find store path.
It was calculating it directly, which is redundant and caused
it to break with shared repositories.
2009-12-15 12:33:04 -08:00
Sune Foldager
69c1e615e4 hgweb: add support for extension-provided permission hooks
This allows extensions to hook into permission checking, providing both
authentication and authorization as needed. The existing authorization
function has been changed to a hook, which is added by default.
2009-11-23 11:03:55 +01:00
Henrik Stuart
b33980d016 hgweb: fix error in bb95879961db and introduce test for change 2009-11-19 15:54:57 +01:00
Sune Foldager
5063be569c ui: add environ property to access os.environ or wsgirequest.environ
The property returns os.environ by default, and is propagated by ui.copy.
During hgweb processing, ui.environ is set to the proper WSGI-request
environment, as contained in wsgirequest.environ. For CGI, this is the
same as os.environ.

The property is meant to be read-only, as with os.environ (generally).
2009-11-19 10:32:33 +01:00
Peter Arrenbrecht
a75765cf7f drop unused imports 2009-05-14 15:35:46 +02:00
Dirkjan Ochtman
5c6c43b746 templater: provide the standard template filters by default 2009-05-12 12:04:05 +02:00
Martin Geisler
750183bdad updated license to be explicit about GPL version 2 2009-04-26 01:08:54 +02:00
Matt Mackall
ba8099cfb8 hgweb: kill parentui references 2009-04-26 16:50:43 -05:00
Matt Mackall
ebffe5ccb8 ui: refactor option setting
No more passing options as constructor keywords. Basic options are now
always stored in the overlay for simplicity and consistency.
2009-04-23 15:40:10 -05:00
Dirkjan Ochtman
0b1a57839b templater: move stylemap function from hgweb to templater 2009-04-04 17:46:11 +02:00
Matt Mackall
642f4d7151 move encoding bits from util to encoding
In addition to cleaning up util, this gets rid of some circular dependencies.
2009-04-03 14:51:48 -05:00
Peter Arrenbrecht
bc21361ed2 cleanup: drop unused imports 2009-03-23 13:12:07 +01:00
Benoit Boissinot
35d90d90ba hgweb: fix allow_read permissions when a user is specified
Thanks to Juan Pablo Aroztegi for reporting and debugging it.
2009-03-07 00:59:41 +01:00
Dirkjan Ochtman
b2c394e625 hgweb: pass ErrorResponses directly into req.respond() 2009-02-09 11:29:09 +01:00
Matt Mackall
e0735a1762 error: move repo errors
rename NoCapability to CapabilityError
2009-01-12 10:42:31 -06:00
Matt Mackall
d15d559b7c errors: move revlog errors
- create error.py for exception classes to reduce demandloading
- move revlog exceptions to it
- change users to import error and drop revlog import if possible
2009-01-11 22:48:28 -06:00
Dirkjan Ochtman
e91c670197 hgweb: fix long line lengths introduced in 9c98746d7c2b 2009-01-03 21:44:15 +01:00
Mark Edgington
fcbe766152 hgweb: send HTTP unauthorized error when denying pull 2009-01-03 20:50:06 +01:00
Mark Edgington
173e246bb8 hgweb: allow static content when deny_read denies access 2009-01-03 20:33:19 +01:00