'hg serv' case insensitive?

Thomas Arendsen Hein thomas at intevation.de
Mon Jun 5 12:26:27 CDT 2006


* Satish Balay <balay at mcs.anl.gov> [20060605 18:31]:
> On Mon, 5 Jun 2006, Thomas Arendsen Hein wrote:
> 
> > * Satish Balay <balay at fastmail.fm> [20060602 18:01]:
> > > I've attempted to export a hg repository using 'hg serv --webdir-conf'
> > > option.
> > > 
> > > The repository is named FooBar - but 'hg serv' is exporting it as
> > > 'foobar' [ignoring the caps]. I was expecting 'FooBar' to work.
> > 
> > > echo "[paths]" > webdir.conf
> > > echo "FooBar=FooBar" >> webdir.conf
> > 
> > The config algorithm lowercases the config keys (the first FooBar),
> > so this will be read as 'foobar=FooBar'.
> > 
> > If you need uppercase or mixed case paths, you can use the
> > hgwebdir.cgi script and pass the repositories as a list or
> > dictionary, e.g.:
> > 
> > repos = [
> >     'FooBar',
> >     'Baz',
> >     ('virtual', 'real/path'),
> >     ('SomeThing', 'located/here'),
> > ]
> > 
> > hgweb.hgwebdir([isinstance(repo, tuple) and repo or (repo, repo)
> >                 for repo in repos]).run()
> 
> I've got errors with this [when I attempt to access http://localhost:8000/]
> 
> ------
> asterix:/home/balay/tmp>cat webdir.conf
> [path]
> repos = [ 'FooBar' ]
> 
> hgweb.hgwebdir([isinstance(repo, tuple) and repo or (repo, repo) for repo in repos]).run()
> 
> asterix:/home/balay/tmp>hg serv --webdir-conf webdir.conf

No, hgwebdir.cgi is not hgwebdir.conf, but it is a CGI script!
You need a web server to use it, see
http://www.selenic.com/mercurial/wiki/index.cgi/PublishingRepositories

Changing the parsing algorithm for hgwebdir.conf would be
complicated, because Python does the lowercasing, not Mercurial.


An alternative which doesn't have to use the CGI-Skript is using
collections, your webdir.conf should contain:

[collections]
/prefix/to/strip/off = /root/of/tree/full/of/repos

Your FooBar repo should be in /root/of/tree/full/of/repos then, if
you set /prefix/to/strip/off to the same value, FooBar will be at
http://localhost:8000/FooBar
(but so will all other repositories next to it, too!)

Thomas

-- 
Email: thomas at intevation.de
http://intevation.de/~thomas/


More information about the Mercurial mailing list