def format_summary_line(web_url, user, base, tip, branch, node):
 revcount = (tip - base)
 plural = ('s' if (revcount > 1) else '')
 if web_url:
  shortlog_base_url = (web_url.rstrip('/') + '/shortlog/')
  summary_url = '{shortlog}{tip}?revcount={revcount}'.format(shortlog=shortlog_base_url, tip=(tip - 1), revcount=revcount)
  formatted_commit_count = '[{revcount} commit{s}]({url})'.format(revcount=revcount, s=plural, url=summary_url)
 else:
  formatted_commit_count = '{revcount} commit{s}'.format(revcount=revcount, s=plural)
 return u'**{user}** pushed {commits} to **{branch}** (`{tip}:{node}`):\n\n'.format(user=user, commits=formatted_commit_count, branch=branch, tip=tip, node=node[:12])

def format_summary_line ( web_url , user , base , tip , branch , node ) : revcount = ( tip - base ) plural = ( 's' if ( revcount > 1 ) else '' ) if web_url : shortlog_base_url = ( web_url . rstrip ( '/' ) + '/shortlog/' ) summary_url = '{shortlog}{tip}?revcount={revcount}' . format ( shortlog = shortlog_base_url , tip = ( tip - 1 ) , revcount = revcount ) formatted_commit_count = '[{revcount} commit{s}]({url})' . format ( revcount = revcount , s = plural , url = summary_url ) else : formatted_commit_count = '{revcount} commit{s}' . format ( revcount = revcount , s = plural ) return u'**{user}** pushed {commits} to **{branch}** (`{tip}:{node}`):\n\n' . format ( user = user , commits = formatted_commit_count , branch = branch , tip = tip , node = node [ : 12 ] )
format the first line of the message .