Commit Graph

224 Commits

Author SHA1 Message Date
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
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
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
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
d4de823a64 merge with crew-stable 2007-02-16 05:27:37 -02: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
b95f1add5a hgweb: allow static files to be served directly by the HTTP server 2007-02-15 08:51:32 -02: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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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