6

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?

Lóránt Pintér
  • 10,152
  • 14
  • 47
  • 53

3 Answers3

3

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.

Zach Kelling
  • 52,505
  • 13
  • 109
  • 108
2

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.)

0

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

[web]
collapse = yes
C2H5OH
  • 5,452
  • 2
  • 27
  • 39