hgweb for bzr
Goffredo Baroncelli
kreijack at inwind.it
Wed Nov 16 23:08:17 GMT 2005
On Wednesday 16 November 2005 16:20, you (Paul TBBle Hampson) wrote:
> Just installed the hgweb interface at http://bzr.tbble.net/hgweb.cgi,
> nice work.
>
> However, it seems it won't work if it's set at the Index file for the
> root directory of the website... The generated URL for the repositories
> (this is hgwebdir.cgi) came out as http://libnifi/ rather than
> http://bzr.tbble.net/hgwebdir.cgi/libnifi or whatever I was expecting to
> see.
Ok, there are two problems:
1) the first one is that hgweb doesn't handle very well a url empty; the patch
below should solve the problem
=== modified file 'bzrlib/plugins/webserve/hgweb.py'
--- bzrlib/plugins/webserve/hgweb.py
+++ bzrlib/plugins/webserve/hgweb.py
@@ -1411,7 +1411,8 @@
- url = ('/'+os.environ["REQUEST_URI"]+'/'+v).replace("//","/")
+ url = '/'+os.environ["REQUEST_URI"]+'/'+v
+ while url.find("//") >= 0 : url = url.replace("//","/")
if not r.startswith("http://"):
lastupdate = os.stat(os.path.join(r, ".bzr",
"revision-history")).st_mtime
2) another problem can be the apache configuration. The config below, handle the
case where the hgwebdir is at the root of the webserve:
-------------
<NameVirtualHost *
<VirtualHost *>
ServerAdmin webmaster at localhost
DocumentRoot /home/ghigo/bazaar/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature On
Alias / /home/ghigo/bazaar/hgwebdir.cgi/
<Directory "/home/ghigo/bazaar">
DirectoryIndex index.cgi
AllowOverride None
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch Indexes
Order allow,deny
Allow from all
AddHandler cgi-script .cgi
</Directory>
</VirtualHost>
-----------------
> Just thought I'd mention it, I didn't see it in the known bugs section
> of the README.
My code is without bug !!!! :-)
>
> Also, it'd be nice if you stole the bzrweb feature of having the file
> that defines the author and description of a repository come from that
> repository itself. ^_^
It is possible; mercurial does so; but were in the repository is stored/should
be store this kind of information ?
Goffredo
--
gpg key@ keyserver.linux.it: Goffredo Baroncelli (ghigo) <kreijack AT inwind.it>
Key fingerprint = CE3C 7E01 6782 30A3 5B87 87C0 BB86 505C 6B2A CFF9
More information about the bazaar
mailing list