diff options
author | dakkar <dakkar@thenautilus.net> | 2009-01-17 17:59:35 +0100 |
---|---|---|
committer | dakkar <dakkar@thenautilus.net> | 2009-01-17 17:59:35 +0100 |
commit | 5e89bc99f6632f1111307d02ff68e1751caf170c (patch) | |
tree | b18d9fab4906fde77073389221129be63ce0b7a0 | |
parent | added support for cgit (tested) (diff) | |
download | gitosis-dakkar-5e89bc99f6632f1111307d02ff68e1751caf170c.tar.gz gitosis-dakkar-5e89bc99f6632f1111307d02ff68e1751caf170c.tar.bz2 gitosis-dakkar-5e89bc99f6632f1111307d02ff68e1751caf170c.zip |
patch from lu_zero, for cgit groups
-rw-r--r-- | gitosis/cgit.py | 36 |
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): """ |