Mercurial server running multiple repositories

I'm using TortoiseHg, and I want to run it as a server. I've been able to run the server, pointing it to the root of the repository I've chosen.

I'm looking for a way to have a folder C:\projects, with multiple repositories inside, pointing my Hg server to that folder, and i would access my repositories like:

Can someone help me please?

Upvotes: 4

Views: 3289

Answers (3)

Giorgi Tsiklauri
Giorgi Tsiklauri

Reputation: 11138

you should edit the hgweb.config file, as it is by default of view like:

[web]
style = gitweb

[collections]
<br>
/mercurial/collections = /mercurial/collections

so, assume that record as first /mercurial/collections is the identifier name whereas second (right side from equals sign) stands for physical path of repo.

for example, I have made it like:

[web]
style = gitweb

[collections]
myrepo1 = /mercurial/repositories/hang_over
myrepo2 = /mercurial/repositories/first_repo
myrepo3 = /mercurial/repositories/javaforever

Im making this under linux ubuntu distribution version.

anyways, here mercurial directory is in my root directory and I'm pointing from it to /mercurial/repositories.

hope it helped you.

Sincerely.

Upvotes: 2

Helgi
Helgi

Reputation: 5436

While using a full web server for repo hosting, as suggested by Lasse, is a good idea, nothing prevents you from serving multiple repositories using hg serve.

Here's my hgweb.config file:

[paths]
project-a = C:/hg/project-a/
library-b = C:/hg/library-b/

I start hg serve with this command:

hg serve --address 127.0.0.1 --port 8000 --webdir-conf C:/hg/hgweb.config --encoding utf8

Upvotes: 12

Lasse V. Karlsen
Lasse V. Karlsen

Reputation: 391634

For that you need to set up a full web server, either IIS or Apache, and host hgweb, the Python cgi script that Mercurial comes with (you may have to download the source for this.)

See Publishing Repositories with hgwebdir.cgi for more details.

Upvotes: 1

Related Questions