Commit Graph

324 Commits

Author SHA1 Message Date
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
Thomas Arendsen Hein
b9e5f69a2d Explicitly use "tip" in revision navigation.
Rationale: the tip revision is a moving target and if somebody wants tip,
it should be delivered.
2006-10-16 22:44:44 +02:00
Alexis S. L. Carvalho
a85d162373 Use a case-sensitive version of SafeConfigParser everywhere
This change has the potential to break existing setups, but the current
behaviour (the keys in configuration files are always lower-cased) can
bite us in a few places:

- no way to use a Command in [defaults]
- hgext.Extension doesn't work in [extensions]
- you can't use an Upper/case/PATH in the [paths] section of hgweb.config
- you can't (easily) protect paths with upper-case letters with the
  acl extension
- you can't specify a /Path/TO/a/rEPO in the [reposubs] section for
  the notify extension
2006-10-16 15:38:53 -03:00
Brendan Cully
cdb8274462 Fix test-oldcgi after navbar update 2006-10-16 11:36:57 -07:00
Brendan Cully
890887a258 Fix RSS URLs (closes issue396) 2006-10-16 11:18:06 -07:00
Brendan Cully
54071df886 Convert changenav bar from revisions to hashes (closes issue189) 2006-10-16 11:02:11 -07:00
Thomas Arendsen Hein
9e3220d4f8 Fixed page overlap for file revision links in hgweb.
This is another step to fix issue189, but currently the file revision numbers
are read as changeset revision numbers, so the link will point to the wrong
revision.
2006-10-16 09:53:31 +02:00
Brendan Cully
2729969583 hgweb: hoist changenav up, and use it in the filelog 2006-10-15 23:51:28 -07:00
Brendan Cully
750f8d53a2 hgweb: link to file parents in filediff, rather than changeset parents 2006-10-15 21:20:15 -07:00
Brendan Cully
63d34eb36b Back out da2c890e2644 and 278eadc04b61 2006-10-15 18:25:07 -07:00
Brendan Cully
6230c1e325 Make annotate use linkrev instead of rev 2006-10-15 17:38:07 -07:00
Brendan Cully
787573732f hgweb: add changeset description to file revision page 2006-10-14 16:27:51 -07:00
Brendan Cully
e633508c32 hgweb: really fix parent/child rename links 2006-10-14 16:20:22 -07:00
Brendan Cully
ec6431254d hgweb: fix parent/child links across renames 2006-10-14 16:03:23 -07:00
Brendan Cully
66d9f73786 hgweb: add changeset description to annotate page 2006-10-14 15:28:45 -07:00
Benoit Boissinot
5b572db4db hgweb: fix path cleaning 2006-10-13 16:34:58 +02:00
Thomas Arendsen Hein
10593de67b Keep session variables when linking from hgwebdir's index to repositories. 2006-10-12 17:06:51 +02:00
Thomas Arendsen Hein
01e8022cb1 hgweb: Apply the new method of passing session variables to links. 2006-10-11 22:01:24 +02:00
Thomas Arendsen Hein
0a1b56c636 hgweb: Keep session variables (currently only style) in HTML forms, too.
Adjusted default and gitweb template for this.
2006-10-11 20:59:37 +02:00
Brendan Cully
0504e469fe hgweb: trap lookup errors 2006-10-11 16:56:41 -07:00
Brendan Cully
2c17d58455 Add better error message for bad commands 2006-10-11 16:50:17 -07:00
Brendan Cully
79084fa005 gitweb: fix last change field in summary 2006-10-11 16:32:06 -07:00
Brendan Cully
d91d2a7969 hgweb: globally default to tip if no revision is specified 2006-10-11 11:30:59 -07:00
Brendan Cully
b373d10384 Add base URL to hgwebdir templater (fixes index page when the URL does not have a trailing /) 2006-10-10 10:54:22 -07:00
Brendan Cully
951d20240e NWI base URL detection fixes 2006-10-10 10:28:20 -07:00
Matt Mackall
7f2b842075 hgweb: add file sizes to manifest browsing 2006-10-10 00:07:46 -05:00
Matt Mackall
37abb9909c hgweb: remove obsolete listfiles function 2006-10-09 23:46:05 -05:00
Thomas Arendsen Hein
2ee8d98180 hgweb: Search templates in templatepath/style/map, too, using a common function.
This allows for web templates to be self-contained in a directory, which makes
copying and modifying them easier.
2006-10-06 18:28:50 +02:00
Brendan Cully
7c7a163df2 hgweb: be more conservative about expanding SCRIPT_NAME 2006-10-05 15:36:53 -07:00
Brendan Cully
3bd24cf35e hgweb: fix NWI parsing when hgwebdir isn't at / 2006-10-05 14:45:15 -07:00
Brendan Cully
b9613f325a hgweb: provide means for handling query parameters 2006-10-05 14:27:14 -07:00
Thomas Arendsen Hein
44070a89f6 hgweb: Added safety net for PATH_INFO starting with double slash.
This happens e.g. when using the following apache config:
  RewriteRule (.*) /hgwebdir/$1 [PT]
instead of the less readable (but more correct):
  RewriteRule (.*) /hgwebdir$1 [PT]
2006-10-05 11:57:38 +02:00
Brendan Cully
7722a4de37 hgweb: support for generating and parsing NWI URLs 2006-10-04 17:04:40 -07:00
Brendan Cully
825f7b89ed Teach hgwebdir about new interface 2006-10-04 17:04:40 -07:00
Brendan Cully
8c204fda3d hgweb: extract raw prefix from NWI commands 2006-10-04 17:04:40 -07:00
Brendan Cully
8e67b8f4bf hgweb: accept NewWebInterface URLs 2006-10-04 17:04:40 -07:00
Wojciech Milkowski
8785ba977a Fix static file serving over HTTP on Windows.
Files to be served should be opened in binary mode.
2006-10-04 18:06:03 +02:00
Benoit Boissinot
b58f394b3c fix warnings from pychecker 2006-10-02 21:10:31 +02:00
Brendan Cully
390726ea06 hgweb: add methods to get contexts from request 2006-10-01 12:56:58 -07:00
Thomas Arendsen Hein
0a7b982aa6 Whitespace/Tab cleanup 2006-10-01 19:26:33 +02:00
Edouard Gomez
e679142f8d Add style support to hgwebdir 2006-09-21 21:24:26 +02:00
Brendan Cully
85dff9928e hgweb: use contexts in more handlers 2006-09-30 21:32:29 -07:00
Brendan Cully
c97293d3eb hgweb: teach siblings and callers to use contexts 2006-09-29 16:26:09 -07:00
Brendan Cully
768e7d3ebd hgweb: kill off #filenode# 2006-09-29 16:26:09 -07:00
Brendan Cully
ebabaa1a54 hgweb: kill #manifest# 2006-09-29 16:26:09 -07:00
Brendan Cully
2bba3f27c5 gitweb: cosmetic fixes.
Fix the padding around the changelog description.
Alternate row colours for the changeset file list.
2006-09-27 12:08:33 -07:00
Brendan Cully
96206c5322 hgweb: yield filenode as well as node in annotate, use filenode in annotateline 2006-09-27 12:08:32 -07:00
Brendan Cully
bdb9096ffa hgweb: fix changeset link in annotate view. 2006-09-27 12:08:30 -07:00
Brendan Cully
96b5443293 hgweb: make annotate line revisions point to annotation for that rev 2006-09-27 09:10:31 -07:00
Brendan Cully
28bde50134 hgweb: use filectx.annotate instead of filelog 2006-09-27 09:10:28 -07:00
Benoit Boissinot
2caa3e642d fix warnings spotted by pychecker 2006-09-18 17:43:31 +02:00
Benoit Boissinot
5d5586c52d hgweb: fix errors spotted by pychecker 2006-09-18 17:32:28 +02:00
Thomas Arendsen Hein
3bf23a7d35 If local repository is missing, make error message clearer.
Faheem Mitha suggested finding a better error message.
The nice error message is taken from cogito.
2006-09-11 10:08:30 +02:00
Thomas Arendsen Hein
645ecf61cd Fix hgweb's patch display in changeset view. 2006-08-18 13:06:38 +02:00
Matt Mackall
6ecbc46d1a Move ui.diffopts to patch.diffopts where it belongs 2006-08-15 11:34:08 -05:00
Giorgos Keramidas
95e3cba367 hgweb: repo.changes() is now called repo.status() 2006-08-13 18:01:44 +03:00
Vadim Gelfer
13d751feaf refactor text diff/patch code.
rename commands.dodiff to patch.diff.
rename commands.doexport to patch.export.
move some functions from commands to new mercurial.cmdutil module.
turn list of diff options into mdiff.diffopts class.

patch.diff and patch.export now has clean api for call from 3rd party
python code.
2006-08-12 16:13:27 -07:00
Vadim Gelfer
dc377b58c1 update copyrights. 2006-08-12 12:30:02 -07:00
Alexis S. L. Carvalho
219803f060 Fix some bugs introduced during the manifest refactoring 2006-08-12 08:53:23 -03:00
Matt Mackall
44b96c96eb Change remaining users of manifest flags 2006-08-11 10:57:42 -05:00
Benoit Boissinot
56e758020e merge gitweb with crew 2006-07-27 02:37:04 +02:00
Vadim Gelfer
0778999161 hooks: add url to changegroup, incoming, prechangegroup, pretxnchangegroup hooks
all repository classes now have url() method that returns url of repo.
2006-07-25 13:50:32 -07:00
Josef "Jeff" Sipek
5d12a047d0 [hgweb] Implemented shortlog (gitweb templates only) 2006-07-24 20:56:30 -04:00
Josef "Jeff" Sipek
c45ef63c97 [hgweb] Fixed up gitweb templates
Now the gitweb templates have archive links
2006-07-24 20:10:04 -04:00
Frank Kingswood
b817bf8839 hgweb: Configurable zebra stripes
With this change, you can set
    [web]
    stripes=3
to get stripes every three lines (a-la fanfold paper), instead of every
line on source and directory listings. The default behaviour is stripes=1
which generates output similar to current, and you can also turn stripes
off by setting it to 0.
2006-07-24 23:06:05 -07:00
Brendan Cully
dd9b6af1b4 Make hgweb threads into daemon threads.
This fixes the problem that an interrupted hg serve will not terminate
until the next request has been received.
2006-07-20 21:58:25 -07:00
Vadim Gelfer
a7bbf7d88f rename stream hgrc option to compressed. 2006-07-16 10:04:16 -07:00
Vadim Gelfer
f7b6882acb clone: disable stream support on server side by default.
enable in hgrc like this:
[server]
stream=True
2006-07-15 16:06:35 -07:00
Vadim Gelfer
9ea4436262 add support for streaming clone.
existing clone code uses pull to get changes from remote repo.  is very
slow, uses lots of memory and cpu.

new clone code has server write file data straight to client, client
writes file data straight to disk.  memory and cpu used are very low,
clone is much faster over lan.

new client can still clone with pull, can still clone from older servers.
new server can still serve older clients.
2006-07-14 11:17:22 -07:00
Vadim Gelfer
e0b0ae3431 clean up trailing white space. 2006-07-12 08:28:00 -07:00
Alexis S. L. Carvalho
39d9875f38 Respect "Connection: close" headers sent by HTTP clients.
A HTTP client can indicate that it doesn't support (or doesn't want)
persistent connections by sending this header.

This not only makes the server more compliant with the RFC, but also
reduces the run time of test-http-proxy when run with python 2.3 from
~125s to ~5s (it doesn't affect it with python 2.4, which was already
~5s).
2006-07-07 14:33:51 -03:00
Haakon Riiser
7b06333d1a diff: add -b/-B options 2006-06-29 15:16:25 +02:00
Benoit Boissinot
7dd019b60b use __contains__, index or split instead of str.find
str.find return -1 when the substring is not found, -1 evaluate
to True and is a valid index, which can lead to bugs.
Using alternatives when possible makes the code clearer and less
prone to bugs. (and __contains__ is faster in microbenchmarks)
2006-07-09 01:30:30 +02:00
Alexis S. L. Carvalho
741f652c36 hgweb: fix unbundle.
After the WSGI changes, even if a push over HTTP succeeds, apache
complains about "Premature end of script headers: hgwebdir.cgi" and
returns a "HTTP Error 500: Internal Server Error", making the local hg
abort.

The change to either of the files touched by this patch is enough to fix
this, but I think changing both is a more robust solution.
2006-07-03 00:33:19 -03:00
Eric Hopper
7011a8d5a5 Cleanup hgweb and hgwebdir's run method a bit. 2006-06-30 09:50:25 -07:00
Eric Hopper
39248f1205 Fix hgwebdir to run hgweb using run_wsgi. 2006-06-30 08:47:41 -07:00
Eric Hopper
cbbc59972c Arrange for old copies of CGI scripts to still work. 2006-06-29 19:06:18 -07:00
Eric Hopper
f4e85c5507 Fix raw files in the web UI. 2006-06-29 18:34:26 -07:00
Eric Hopper
a557f02a71 Really fix http headers for web UI and issue 254.
This also arranges for static content to allow a keepalive connection.
2006-06-27 09:33:12 -07:00
Vadim Gelfer
26b73700a8 merge with wsgi changes. 2006-06-27 00:10:41 -07:00
Eric Hopper
8ac8a46249 Put support for persistent connections back in. 2006-06-27 00:09:37 -07:00
Eric Hopper
000dcf2978 Fix two small bugs that would've prevented the web interface and IPv6
from working.
2006-06-27 00:09:35 -07:00
Eric Hopper
4498f60ff4 This patch make several WSGI related alterations.
First, it changes the server to be almost a generic WSGI server.

Second, it changes request.py to have wsgiapplication and
_wsgirequest.  wsgiapplication is a class that creates _wsgirequests
when called by a WSGI compliant server.  It needs to know whether
or not it should create hgwebdir or hgweb requests.

Lastly, wsgicgi.py is added, and the CGI scripts are altered to
use it to launch wsgiapplications in a WSGI compliant way.

As a side effect, all the keepalive code has been removed from
request.py.  This code needs to be moved so that it is exclusively
in server.py
2006-06-27 00:09:33 -07:00
Eric Hopper
a0494b3aa0 Fix server to set up a more WSGI compliant environment. 2006-06-27 00:09:31 -07:00
Thomas Arendsen Hein
58e95b6ac7 Make "[web] allow_push, deny_push" and "[http_proxy] no" use ui.configlist. 2006-06-26 16:47:24 +02:00
Thomas Arendsen Hein
b1e9507c44 Fixed [web] allow_archive for comma separated parameters by using ui.configlist.
Changed tests/test-archive to use allow_archive instead of the deprecated
allowzip, allowgz and allowbz2.
2006-06-26 14:56:14 +02:00
Vadim Gelfer
9420a748d4 push over http: server side authorization support.
new hgrc entries allow_push, deny_push, push_ssl control push over http.

allow_push list controls push.  if empty or not set, no user can push.
if "*", any user (incl. unauthenticated user) can push.  if list of user
names, only authenticated users in list can push.

deny_push list examined before allow_push.  if "*", no user can push.
if list of user names, no unauthenticated user can push, and no users
in list can push.

push_ssl requires https connection for push.  default is true, so password
sniffing can not be done.
2006-06-20 15:23:01 -07:00
Vadim Gelfer
6086f69eb4 push over http: server support.
write "unbundle" verb for http.
2006-06-20 15:16:50 -07:00
Vadim Gelfer
f739175f8c http: query server for capabilities 2006-06-15 17:07:30 -07:00
Vadim Gelfer
b0f5563c91 hgweb: split "verbs" into methods. 2006-06-15 13:27:57 -07:00
Vadim Gelfer
a6efe6d9e6 http server: support persistent connections.
only "hg serve" affected yet.  http server running cgi script will not
use persistent connections.  support for fastcgi will help that.

clients that support keepalive can use one tcp connection for all
commands during clone and pull.  this makes latency of binary search
during pull much lower over wan.

if server does not know content-length, it will force connection to
close at end.  right fix is to use chunked transfer-encoding but this is
easier and does not hurt performance. only command that is affected is
"changegroup" which is always last command during a pull.
2006-06-15 12:55:58 -07:00
Thomas Arendsen Hein
494ca88023 Fixed 'hg serve --webdir-conf foo' which broke due to split of hgweb. 2006-06-05 16:48:24 +02:00
Benoit Boissinot
e0e1e090fa hgweb: fix errors and warnings found by pychecker
- fix missing import
- use type_ instead of type
- remove unused variable
2006-06-04 12:19:51 +02:00
Eric Hopper
1d1293da03 Adjusting hgweb splitup to be a little cleaner. 2006-06-02 08:25:02 -07:00
Eric Hopper
c6fcaec078 Fixing up comment headers for split up code. 2006-06-02 08:05:01 -07:00
Thomas Arendsen Hein
e4abeb4452 Fix automatic decompression of tarballs with Firefox.
The encoding was set to gzip/bzip2, so Firefox (correctly) assumed, that this
has to be "decoded" (i.e. decompressed).
2006-06-01 18:36:32 +02:00
TK Soh
63cd05485f hgweb: fix tracebacks on both index and repo pages 2006-06-01 09:14:27 -05:00
Thomas Arendsen Hein
28d5a5ad5d Allow comma to separate types in allow_archive, too. Use longer variable name. 2006-06-01 17:51:40 +02:00
TK Soh
633f958ebe hgweb: add allow_archive support to [web] section of hgrc 2006-06-01 10:02:24 -05:00
Eric Hopper
0379b620c6 Final stage of the hgweb split up.
hgweb and hgwebdir now have their own modules.
2006-05-31 10:42:44 -07:00
Eric Hopper
20797956ec Splitting up hgweb so it's easier to change. 2006-05-31 08:03:29 -07:00
Alexis S. L. Carvalho
8b1ff2c942 hgweb.manifest: revno of manifest and changelog aren't always the same
In the v4l-dvb repo, the manifest revno and the changelog revno are not
in sync.  This happened because the same patch was applied to the same
revision in two different branches, resulting in the same manifest text,
with the same parents and so the first revision was reused.

Since hgweb.manifest was assuming the revnos of the manifest and of the
changelog were always the same, clicking on manifest -> bz2 in the
v4l-dvb site would download the wrong revision.

Use the linkrev to go from manifest revision to changelog revision.

This still won't be perfect since the page will still talk about
"manifest for changeset XYZ", where XYZ was the first changeset to have
this manifest, which is not necessarily the same changeset that the user
clicked to get to this page - but at least the contents will be the
same.
2006-05-20 15:34:19 -03:00
Eric Hopper
0c1117d5be Moving hgweb.py into it's own module in preparation for breaking it up. 2006-05-18 11:48:33 -07:00