Commit Graph

324 Commits

Author SHA1 Message Date
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
Dirkjan Ochtman
abdd89596c streamclone yields chunks instead of accepting a file-like object 2008-06-29 14:20:01 +02:00
Dirkjan Ochtman
ea85ac1c36 hgweb: protocol functions take repo instead of web
This makes it much easier for implementers of hgweb alternatives to simply
call into protocol functions after setting up a repo and a request.
2008-06-29 11:34:36 +02:00
Dirkjan Ochtman
daead2920b hgweb: move capabilities calculation back into hgweb.protocol 2008-06-29 11:35:08 +02:00
Dirkjan Ochtman
e28d0d4d77 hgweb: centralize permission checks for protocol commands
Consistently enforces authorization checks set up in hgrc up front, so that
the actual commands don't have to worry about them and implementers of
hgweb alternatives can easily implement their own permission checks.
2008-06-29 11:35:06 +02:00
Dirkjan Ochtman
ea809de249 hgweb: protocol requests are processed immediately
This makes separation of interface/webcommands and protocol easier and will
make http repos slightly faster because there's less overhead.
2008-06-28 15:28:43 +02:00
Dirkjan Ochtman
76f4a6be28 merge with mpm 2008-06-28 09:28:01 +02:00
Matt Mackall
a65ef7bc5d util: add sort helper 2008-06-27 18:28:45 -05:00
Dirkjan Ochtman
f174f95f70 hgweb: move shortcut expansion to request instantiation 2008-06-26 13:45:39 +02:00
Matt Mackall
bc715be859 add __len__ and __iter__ methods to repo and revlog 2008-06-26 14:35:50 -05:00
Matt Mackall
fbb5127472 use repo[changeid] to get a changectx 2008-06-26 14:35:46 -05:00
Dirkjan Ochtman
423e92c03a graph: display branch name alongside tags 2008-06-23 12:54:27 +02:00
Benoit Allard
7efee05311 graph: limit the number of displayed changest to a reasonable value 2008-06-18 19:04:10 +02:00
Dirkjan Ochtman
4f94568371 add graph page to hgweb 2008-06-18 07:06:41 +02:00
Dirkjan Ochtman
8cce533c21 merge from crew-stable 2008-06-13 12:34:23 +02:00
Ali Saidi
665e4dbff1 fix traceback in hgweb when URL doesn't end in one of the archive specs
If the last n charecters of the URL doesn't match an entry in archive_specs
req.form never has a key 'type'. When achive() looks up 'type' in the form
dict  it causes a traceback rather than printing an error message.
2008-06-13 12:33:40 +02:00
Andrew Beekhof
e91a885fe8 webcommands: fix increments lost by 4858a155c4aa 2008-06-11 14:49:53 +02:00
Dirkjan Ochtman
cd5e863912 hgweb: show cset node and description when hovering over annotate prefix 2008-06-07 17:52:00 +02:00
Dirkjan Ochtman
d5bb71e5c9 merge from crew-stable 2008-05-29 22:23:33 +02:00
Benoit Boissinot
6b96c655db hgweb: correctly validate permissions with streamclone pulling 2008-05-26 14:20:26 +02:00
Patrick Mezard
56830b39f0 webcommands: pass full author to annotate, fix templates (issue 1054) 2008-04-23 22:45:53 +02:00
Dirkjan Ochtman
95639b6467 hgweb: make hgwebdir work in the absence of PATH_INFO
Thanks to Andrea Arcangeli for reporting and an initial patch.
2008-04-03 13:14:43 +02:00
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