# # # patch "branch.psp" # from [0fd5280a8d954d769ac708db08743ce391fb934c] # to [a894fc2db554fbf665e1b5b540a5ed35acac5aba] # # patch "common.py" # from [1fdb62e05fb2a9338d2c72ddc58de3ab2b3976fe] # to [755634178ad470975e6cb0f960b9ee83f3df7450] # # patch "html.py" # from [918ee71ec6f5ccb116ed425671dd1cad616c9079] # to [1832f26b3391d38da46c1431af1be33ee7d65059] # # patch "revision.psp" # from [ed955d64d22c2dca62a89eb8b6484d19acec5db1] # to [d79d6a8b9ab04332baeb0745c6ad7c18f00ab8f6] # ============================================================ --- branch.psp 0fd5280a8d954d769ac708db08743ce391fb934c +++ branch.psp a894fc2db554fbf665e1b5b540a5ed35acac5aba @@ -25,15 +25,35 @@ try: page = int(form['page']) except: pass +if form.has_key('rss'): + output = 'rss' +else: + output = 'html' + if page < 1: page = 1 display = 10 offset = page * display branch = form['branch'] -info = {'title' : "Changes to branch %s" % (hq(branch))} -req.write(template.header(info)) +page_title = "Changes to branch %s" % (hq(branch)) +if output == 'html': + info = { + 'title' : page_title, + 'extra_header' : link('branch_rss', branch) + } + req.write(template.header(info)) +elif output == 'rss': + req.write('''\ + + + en-us + + %s + %s + %s''' % (page_title, config.base_url, page_title)) + heads = mt.heads(branch) recent = mt.toposort(mt.ancestors(heads) + heads) @@ -53,16 +73,24 @@ %> +<% +if output == 'html': + req.write('''\

-This page lists changes <%= -1*(stop or 0) %> through <%= -1 * start %> to <%=link("branch", branch)%>. -It may also be useful to view the <%=link("headofbranch", branch, "current head revision")%> of this branch. -

+This page lists changes %s through %s to %s. +It may also be useful to view the %s of this branch. +

''' % (-1*(stop or 0), (-1 * start), link('branch', branch), link('headofbranch', 'branch', 'current head revision'))) + req.write('') +%> <% -req.write('
') for idx, id in enumerate(recent): certs = mt.certs(id) + if output == 'rss': + req.write('\n') + req.write('%s\n' % (urllib.basejoin(config.base_url, 'revision.psp?id=%s' % (urllib.quote(id))))) + changelog, certdate, quicklog, certinfo = None, None, "", "" for cert in certs: name, value = None, None @@ -72,10 +100,16 @@ if name == None or value == None: continue if name == "date": certdate = apply(datetime.datetime, time.strptime(value, "%Y-%m-%dT%H:%M:%S")[:6]) - if name == "branch": + if output == 'rss': req.write("\t%s\n" % hq(certdate.strftime("%a, %d %m %Y %H:%M:%S +0000"))) + elif name == "branch": value = link("branch", value) else: - if name == "changelog": quicklog = hq(value.strip().split('\n')[0]) + if name == "changelog": + quicklog = hq(value.strip().split('\n')[0]) + if quicklog.startswith('*'): quicklog = quicklog[1:].strip() + if output == 'rss': req.write("\t%s\n%s\n" % (quicklog, hq(value))) + elif name == "author": + if output == 'rss': req.write("\t%s\n" % (hq(value))) value = '
'.join(map(hq, value.split('\n'))) certinfo += '
\n' % (prettify(name), value) @@ -91,28 +125,36 @@ minutes = ago.seconds / 60 seconds = (ago.seconds - (minutes * 60)) ago = "%d minutes, %d seconds" % (minutes, seconds) - style = "font-size: 130%%; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: black;" - if idx != 0: - style += "border-top-style: solid; border-top-width: 1px; border-top-color: black;" - req.write('\n' % (style, ago, quicklog, link("revision", id, "more info"))) - req.write(certinfo) -req.write('
%s:%s
%s ago: %s (%s)
') -%> + if output == 'html': + style = "font-size: 130%%; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: black;" + if idx != 0: + style += "border-top-style: solid; border-top-width: 1px; border-top-color: black;" + req.write('%s ago: %s (%s)\n' % (style, ago, quicklog, link("revision", id, "more info"))) + req.write(certinfo) + elif output == 'rss': + req.write('\n') -<% -c = [] -if page != 1: - c.append('Newer changes' % (urllib.quote(branch), page-1)) -if not no_next: - c.append('Older changes' % (urllib.quote(branch), page+1)) -req.write('

' + ' | '.join(c) + '

') +if output == 'html': + req.write('') + c = [] + if page != 1: + c.append('Newer changes' % (urllib.quote(branch), page-1)) + if not no_next: + c.append('Older changes' % (urllib.quote(branch), page+1)) + req.write('

' + ' | '.join(c) + '

') + %> <% -req.write(template.footer(info)) - +if output == 'html': + req.write(template.footer(info)) +elif output == 'rss': + req.write('''\ +
+
+''') %> ============================================================ --- common.py 1fdb62e05fb2a9338d2c72ddc58de3ab2b3976fe +++ common.py 755634178ad470975e6cb0f960b9ee83f3df7450 @@ -62,6 +62,8 @@ return rv elif link_type == "manifest": return '[' + hq(link_to[:8]) + '..]' + elif link_type == "branch_rss": + return '' % (urllib.quote(link_to), hq(description or ("RSS feed for " + link_to))) else: rv = 'Unknown link type: %s' % (hq(link_type)) return rv ============================================================ --- html.py 918ee71ec6f5ccb116ed425671dd1cad616c9079 +++ html.py 1832f26b3391d38da46c1431af1be33ee7d65059 @@ -5,6 +5,7 @@ class Template: def header(self, info): if not info.has_key("title"): info['title'] = "untitled" + if not info.has_key("extra_header"): info['extra_header'] = '' return """\ @@ -12,6 +13,8 @@ ViewMTN: %(title)s + + %(extra_header)s