Yet another hgweb config question

Patrick Waugh ptwaugh at gmail.com
Thu Nov 6 03:06:06 CST 2008


Well, after using Hg for a bit, I decided I wanted to change my basic
hgweb config a bit, but I have a couple questions now as a result of
my efforts.

When I first stated, I just soft of blindly set it up, and while it
worked, it didn't make sense.

For my private repo, I have setup:  /home/patrick/public_html/repo

with hgwebdir.cgi, and hgweb.config.  But instead of putting every
repository directory from diverse projects under this repo directory,
I wanted to put them in "related" sub-directories so that I would only
be looking at say:

$ls -l

drwxrwxrwx 2 patrick patrick 4096 2008-10-31 22:36 art
drwxr-xr-x 4 patrick patrick 4096 2008-11-04 02:09 common
drwxr-xr-x 8 patrick patrick 4096 2008-11-04 02:49 dib_8800
drwxr-xr-x 8 patrick patrick 4096 2008-11-04 02:49 dib_8800-stable

for example.  Originally, I was thinking I wanted to have "separate"
hgwebdir indexes for each "project" for similar reasons, but decided
that this amounted to creating separate web sites and wasn't worth the
trouble.

Now, while the "index" page (hgwebdir.cgi) shows up fine, once I put
.htaccess in place to clean up the URL I notice two things:

a) Before I could go to: localhost/~patrick/repo, but now I have to
use the explicit URL:
localhost/~patrick/repo/hgwebdir.cgi.  (Note: I have added
hgwebdir.cgi to the apache config)

b) More importantly, while I can see the "index" page, when I click on
the repository I want to view, it cannot be found.  For example, if I
want to view the dib_8800 repo, and highlight the "link" in the index
page it shows this URL:  http://localhost/repo/dib_8800, when the
actual location is /home/patrick/public_html/repo/dib/dib_8800.


hgwebconfig looks like this:

[collections]
#/home/patrick/repo/dib = /home/patrick/repo/dib
bb-ant-tools/ = bb-ant-tools/
cbl/ = cbl/
dib/ = dib/
hg/ = hg/
perldesk/ = perldesk/
sd/ = sd/
sdplugins/ = sdplugins/
zencart/ = zencart/

[web]
baseurl = /repo

while .htaccess looks like this:

Options +ExecCGI

RewriteEngine On
RewriteBase /repo
RewriteRule ^$ hgwebdir.cgi [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) hgwebdir.cgi/$1 [QSA,L]

Now, I'm guessing that I can't do this (have the repos divided up in
sub-directories), but if I can configure it this way, tell me how.  =)

Now if I can't do this, it's really ok, because now I'm thinking that
it would be better for me to just have them all under the one
directory (repo), and then clone those to a real "working" directory
say /home/patrick/repo/{someproject}

And then I don't have to look at all those directories while I'm
working, and just push back my changes.

Thoughts?

Patrick


More information about the Mercurial mailing list