Skip to content

Commit

Permalink
made create_trunks importable
Browse files Browse the repository at this point in the history
  • Loading branch information
a8 committed Jul 17, 2011
1 parent c342e8f commit 8b16c04
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions tools/create_trunks.py
Expand Up @@ -39,11 +39,15 @@ def import_from_string(name):
setup_environ(settings)
from codespeed.models import Branch, Project

projects = Project.objects.all()

for proj in projects:
if not proj.branches.get(name='default'):
trunk = Branch(name='default', project = proj)
trunk.save()
print "Created branch 'default' for project {0}".format(proj)

def main():
"""Add Branch default to projects if not there"""
projects = Project.objects.all()

for proj in projects:
if not proj.branches.get(name='default'):
trunk = Branch(name='default', project = proj)
trunk.save()
print "Created branch 'default' for project {0}".format(proj)

if __name__ == '__main__':
main()

0 comments on commit 8b16c04

Please sign in to comment.