Allura/allura/model/repo_refresh.py
def send_notifications(repo, commit_ids):
    """Create appropriate notification and feed objects for a refresh

    :param repo: A repository artifact instance.
    :type repo: Repository

    :param commit_ids: A list of commit hash strings.
    :type commit_ids: list
    """
    from allura.model import Feed, Notification
    commit_msgs = []
    base_url = tg.config['base_url']
    last_branch = []
    for oids in utils.chunked_iter(commit_ids, QSIZE):
        chunk = list(oids)
        index = dict(
            (doc._id, doc)
            for doc in Commit.query.find(dict(_id={'$in': chunk})))
        for oid in chunk:
            ci = index[oid]
            href = repo.url_for_commit(oid)
            title = _title(ci.message)
            summary = _summarize(ci.message)
            Feed.post(
                repo, title=title,
                description='%s<br><a href="%s">View Changes</a>' % (
                    summary, href),
                author_link=ci.author_url,
                author_name=ci.authored.name,
                link=href,
                unique_id=href)

            summary = g.markdown_commit.convert(ci.message) if ci.message else ""

            current_branch = repo.symbolics_for_commit(ci)[0]
            if last_branch == current_branch:
                branches = []
            else:
                branches = current_branch
                last_branch = branches

            commit_msgs.append(dict(
                author=ci.authored.name,
                date=ci.authored.date.strftime("%m/%d/%Y %H:%M"),
                summary=summary,
                branches=branches,
                commit_url=base_url + href))

    if commit_msgs:
        if len(commit_msgs) > 1:
            subject = u"{} new commits to {}".format(len(commit_msgs), repo.app.config.options.mount_label)
        else:
            subject = u'New commit by {}'.format(commit_msgs[0]['author'])
        template = g.jinja2_env.get_template("allura:templates/mail/commits.md")
        text = u"\n\n-----".join([template.render(d) for d in commit_msgs])

        Notification.post(
            artifact=repo,
            topic='metadata',
            subject=subject,
            text=text)
Create appropriate notification and feed objects for a refresh

    :param repo: A repository artifact instance.
    :type repo: Repository

    :param commit_ids: A list of commit hash strings.
    :type commit_ids: list
    
Create appropriate notification and feed objects for a refresh
Create appropriate notification and feed objects for a refresh
def send_notifications(repo, commit_ids):
    from allura.model import Feed, Notification
    commit_msgs = []
    base_url = tg.config['base_url']
    last_branch = []
    for oids in utils.chunked_iter(commit_ids, QSIZE):
        chunk = list(oids)
        index = dict(
            (doc._id, doc)
            for doc in Commit.query.find(dict(_id={'$in': chunk})))
        for oid in chunk:
            ci = index[oid]
            href = repo.url_for_commit(oid)
            title = _title(ci.message)
            summary = _summarize(ci.message)
            Feed.post(
                repo, title=title,
                description='%s<br><a href="%s">View Changes</a>' % (
                    summary, href),
                author_link=ci.author_url,
                author_name=ci.authored.name,
                link=href,
                unique_id=href)
            summary = g.markdown_commit.convert(ci.message) if ci.message else ""
            current_branch = repo.symbolics_for_commit(ci)[0]
            if last_branch == current_branch:
                branches = []
            else:
                branches = current_branch
                last_branch = branches
            commit_msgs.append(dict(
                author=ci.authored.name,
                date=ci.authored.date.strftime("%m/%d/%Y %H:%M"),
                summary=summary,
                branches=branches,
                commit_url=base_url + href))
    if commit_msgs:
        if len(commit_msgs) > 1:
            subject = u"{} new commits to {}".format(len(commit_msgs), repo.app.config.options.mount_label)
        else:
            subject = u'New commit by {}'.format(commit_msgs[0]['author'])
        template = g.jinja2_env.get_template("allura:templates/mail/commits.md")
        text = u"\n\n-----".join([template.render(d) for d in commit_msgs])
        Notification.post(
            artifact=repo,
            topic='metadata',
            subject=subject,
            text=text)
def send_notifications ( repo , commit_ids ) : from allura . model import Feed , Notification commit_msgs = [ ] base_url = tg . config [ 'base_url' ] last_branch = [ ] for oids in utils . chunked_iter ( commit_ids , QSIZE ) : chunk = list ( oids ) index = dict ( ( doc . _id , doc ) for doc in Commit . query . find ( dict ( _id = { '$in' : chunk } ) ) ) for oid in chunk : ci = index [ oid ] href = repo . url_for_commit ( oid ) title = _title ( ci . message ) summary = _summarize ( ci . message ) Feed . post ( repo , title = title , description = '%s<br><a href="%s">View Changes</a>' % ( summary , href ) , author_link = ci . author_url , author_name = ci . authored . name , link = href , unique_id = href ) summary = g . markdown_commit . convert ( ci . message ) if ci . message else "" current_branch = repo . symbolics_for_commit ( ci ) [ 0 ] if last_branch == current_branch : branches = [ ] else : branches = current_branch last_branch = branches commit_msgs . append ( dict ( author = ci . authored . name , date = ci . authored . date . strftime ( "%m/%d/%Y %H:%M" ) , summary = summary , branches = branches , commit_url = base_url + href ) ) if commit_msgs : if len ( commit_msgs ) > 1 : subject = u"{} new commits to {}" . format ( len ( commit_msgs ) , repo . app . config . options . mount_label ) else : subject = u'New commit by {}' . format ( commit_msgs [ 0 ] [ 'author' ] ) template = g . jinja2_env . get_template ( "allura:templates/mail/commits.md" ) text = u"\n\n-----" . join ( [ template . render ( d ) for d in commit_msgs ] ) Notification . post ( artifact = repo , topic = 'metadata' , subject = subject , text = text )
Create appropriate notification and feed objects for a refresh
Create appropriate notification and feed objects for a refresh
"""Create appropriate notification and feed objects for a refresh

    :param repo: A repository artifact instance.
    :type repo: Repository

    :param commit_ids: A list of commit hash strings.
    :type commit_ids: list
    """
repo
A repository artifact instance.
A repository artifact instance .
commit_ids
A list of commit hash strings.
A list of commit hash strings .