'Commits should be ordered oldest to newest.
Calling this method will remove all existing commit history.'

def set_commits(self, version, commit_list):

    if (not Release.is_valid_version(version)):
        raise HookValidationError(('Invalid    release    version:    %s' % version))
    project = self.project
    try:
        with transaction.atomic():
            release = Release.objects.create(organization_id=project.organization_id, version=version)
    except IntegrityError:
        release = Release.objects.get(organization_id=project.organization_id, version=version)
    release.add_project(project)
    release.set_commits(commit_list)
