Merge "Stop showing retired repos in cgit"

This commit is contained in:
Jenkins 2017-09-20 18:30:00 +00:00 committed by Gerrit Code Review
commit d2927bb5e5
1 changed files with 12 additions and 8 deletions

View File

@ -61,9 +61,10 @@ def main():
'DEFAULT_ORG is set.' % project)
(org, name) = (DEFAULT_ORG, project)
description = entry.get('description', name)
retired = entry.get('acl-config', '').endswith('retired.config')
assert project not in names
names.add(project)
gitorgs.setdefault(org, []).append((name, description))
gitorgs.setdefault(org, []).append((name, description, retired))
if SCRATCH_SUBPATH:
assert SCRATCH_SUBPATH not in gitorgs
scratch_path = os.path.join(REPO_PATH, SCRATCH_SUBPATH)
@ -72,7 +73,7 @@ def main():
if not os.path.isdir(scratch_dir):
os.makedirs(scratch_dir)
projects = gitorgs[org]
for (name, description) in projects:
for (name, description, retired) in projects:
scratch_repo = "%s.git" % os.path.join(scratch_dir, name)
subprocess.call(['git', 'init', '--bare', scratch_repo])
subprocess.call(['chown', '-R', '%s:%s'
@ -89,12 +90,15 @@ def main():
org_dir = os.path.join(REPO_PATH, org)
projects = gitorgs[org]
projects.sort()
for (name, description) in projects:
project_repo = "%s.git" % os.path.join(org_dir, name)
cgit_file.write('\n')
cgit_file.write('repo.url=%s/%s\n' % (org, name))
cgit_file.write('repo.path=%s/\n' % (project_repo))
cgit_file.write('repo.desc=%s\n' % (clean_string(description)))
for (name, description, retired) in projects:
if not retired:
project_repo = "%s.git" % os.path.join(org_dir, name)
cgit_file.write('\n')
cgit_file.write('repo.url=%s/%s\n' % (org, name))
cgit_file.write('repo.path=%s/\n' % (project_repo))
cgit_file.write('repo.desc=%s\n' % (description))
cgit_file.write(
'repo.desc=%s\n' % (clean_string(description)))
if not os.path.exists(project_repo):
subprocess.call(['git', 'init', '--bare', project_repo])
subprocess.call(['chown', '-R', '%s:%s'