开发者

mercurial hgweb.config do not find repositories, path issue

开发者 https://www.devze.com 2023-03-30 14:19 出处:网络
I have a repository set up on an apache web server using the hgweb.cgi script declared in my apac开发者_StackOverflow社区he2.conf file as following:

I have a repository set up on an apache web server using the hgweb.cgi script declared in my apac开发者_StackOverflow社区he2.conf file as following:

ScriptAlias /hgp "/var/www/hgrepublic/hgweb.cgi"

In my hgweb.cgi script, if I set the config variable as the path to my repository:

config = "/var/www/hgrepublic/fakecake"

it works and I see the history of my repository at http://localhost/hgp

Now if I want to use the hgweb.config file, I set the config variable in the hgweb.cgi script like:

config = "hgweb.config"

whatever the paths I try to use in config file, I cannot see my repository in the web interface (empty repository index). Here are a few examples I tried with absolute and relative paths

[paths]
/ = /var/www/hgrepublic/**
fakecake = /fakecake
fakecake = /var/www/hgrepublic/fakecake

Any idea to help me make it work with the config file? (I would like to have several repositories declared in the config file)

Note: hgweb cgi and config files are in the /var/www/hgrepublic/ folder as well as the fakecake repository folder.


I found a solution to my own question by looking at the source.

I used a dict in the hgweb.cgi file to pass the different repositories I want to show:

config = {'repo1' : '/path/to/repo1', 'repo2' : '/path/to/repo2'}

It works like this, so I think that there might be a parsing problem in hgweb.config file for [paths] section?


The [paths] section converts the URL to the repository path. Try:

hgweb.config

[paths]
/hpg/fakecake = /var/www/hgrepublic/fakecake
/hpg/repo2 = /var/www/hgrepublic/repo2

hgweb.cgi

config = "hgweb.cgi"  # or /path/to/hgweb.cgi if not in cwd
0

精彩评论

暂无评论...
验证码 换一张
取 消