How to make hgweb display repositories in a hierarchy?

I have about 100 Mercurial repositories served by hgweb. The repositories are stored in a folder hierarchy, but hgweb displays the structure in a "flat" manner. This doesn't scale. Is there a way to display the repositories in a tree-like hierarchy instead?

Upvotes: 6

Views: 1281

Answers (3)

C2H5OH
C2H5OH

Reputation: 5612

I had the same problem, and I solved by enabling the collapse option:

[web]
collapse = yes

Upvotes: 0

David Nagle
David Nagle

Reputation: 21

I'm not sure if this was an option at the time of the question, but there's now an option that enables descending into directories.

[web]
descend = True

You then have two options for how to configure your paths. If you specify a path with a single asterisk, it will descend into subdirectories until it finds repositories.

[paths]
/ = /var/hg/*

If you specify a path with two asterisks, it will also descend into repositories to see if there are nested repositories or subrepositories.

[paths]
/ = /var/hg/**

You can find more details on the Mercurial wiki at PublishingRepositories.

(It sounds as if you may also be looking to have the hierarchy displayed in a tree-like fashion. This solution only impacts which repositories will be detected. It will not change how they are displayed. I'm not aware of any built-in way to accomplish a hierarchical display.)

Upvotes: 2

Zach Kelling
Zach Kelling

Reputation: 53879

I like to organize my repos by type, this is what my hgweb config looks like:

[web]
baseurl =

[paths]
/apps = /var/hg/apps/*
/config = /var/hg/config/*
/design = /var/hg/design/*
/music = /var/hg/music/*
/projects = /var/hg/projects/*
/scripts = /var/hg/scripts/*

You can also use ** to make it display directories recursively.

[paths]
/ = /var/hg/**

Check out the docs for other details/options: http://www.selenic.com/mercurial/hgrc.5.html#web.

You might also be interested in RhodeCode which is a more feature-rich web interface for mercurial.

Upvotes: 3

Related Questions