aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gitosis/cgit.py36
1 files changed, 22 insertions, 14 deletions
diff --git a/gitosis/cgit.py b/gitosis/cgit.py
index 0e85154..c98c2a2 100644
--- a/gitosis/cgit.py
+++ b/gitosis/cgit.py
@@ -44,29 +44,37 @@ def generate_project_list_fp(config, fp):
enable = getboolean_default(config, section, 'cgit', global_enable)
- print >> fp, '#section: %s, local: %d'%(sectiontitle[1],enable)
-
if not enable:
continue
+ groupname = get_default(config, section, 'cgit_group', "")
+ grouped_section.setdefault(groupname,[]).append(section)
- name = sectiontitle[1]
+ for groupname, group in grouped_sections.iteritems():
+ if groupname
+ print >> fp, 'repo.group=%s'%(groupname)
- fullpath = _repository_path(log, repositories, name, name)
+ for section in group:
+ sectiontitle = section.split(None, 1)
+ print >> fp, '#section: %s, local: %d'%(sectiontitle[1],enable)
- print >> fp, 'repo.url=%s'%(name)
+ name = sectiontitle[1]
- if fullpath is None:
- continue
+ fullpath = _repository_path(log, repositories, name, name)
- print >> fp, 'repo.path=%s'%(fullpath)
+ print >> fp, 'repo.url=%s'%(name)
- for field_pair in field_map.iteritems():
- try:
- field_value = config.get(section, field_pair[0])
- except (NoSectionError, NoOptionError):
+ if fullpath is None:
continue
- else:
- print >> fp, '%s=%s'%(field_pair[1],field_value)
+
+ print >> fp, 'repo.path=%s'%(fullpath)
+
+ for field_pair in field_map.iteritems():
+ try:
+ field_value = config.get(section, field_pair[0])
+ except (NoSectionError, NoOptionError):
+ continue
+ else:
+ print >> fp, '%s=%s'%(field_pair[1],field_value)
def _repository_path(log, repositories, name, default_value):
"""