Esempio n. 1
0
def autoinit_repos(config):
    do_init = util.getConfigDefaultBoolean(config, 'gitosis', 'init-on-config', False)
    if not do_init:
        return

    for (section, name, topdir, subpath) in gitweb.enum_cfg_repos(config):
        if os.path.exists(os.path.join(topdir,subpath)):
            continue

        try:
            serve.auto_init_repo(config,topdir,subpath)
        except GitInitError, e:
            log.warning('Auto-init failed: %r' % e)
        except GitError, e:
            log.warning('Git error in init: %r' % e)
Esempio n. 2
0
def autoinit_repos(config):
    try:
        do_init = config.getboolean('gitosis', 'init-on-config')
    except (NoSectionError, NoOptionError):
        do_init = False

    if not do_init:
        return

    for (section, name, topdir, subpath) in gitweb.enum_cfg_repos(config):
        if os.path.exists(os.path.join(topdir,subpath)):
            continue

        try:
            serve.auto_init_repo(config,topdir,subpath)
        except GitInitError, e:
            log.warning('Auto-init failed: %r' % e)
        except GitError, e:
            log.warning('Git error in init: %r' % e)