# # # patch "monotone.py" # from [fc6c160ddb6cdfccd716a8d30504255bc59d776a] # to [32bff5899bbea0917844c9985b7239ecf020c256] # # patch "revision.psp" # from [9d90c20f2b587e81348902ac7891378758588b93] # to [17ec29c1ac742c32a69f6e71b4e4a0c17faf4e3e] # ============================================================ --- monotone.py fc6c160ddb6cdfccd716a8d30504255bc59d776a +++ monotone.py 32bff5899bbea0917844c9985b7239ecf020c256 @@ -10,8 +10,14 @@ # dash_re = re.compile(r'^-+$') -value_re = re.compile(r'^(\S*) *: (.*)$') +cert_value_re = re.compile(r'^(\S*) *: (.*)$') +new_manifest_re = re.compile("^new_manifest \[(\S+)\]$") +old_revision_re = re.compile("^old_revision \[(\S+)\]$") +old_manifest_re = re.compile("^old_manifest \[(\S+)\]$") + +manifest_entry_re = re.compile("^(\S+) *(.*)$") + class Monotone: def __init__(self, mt, dbfile): self.mt = mt @@ -39,7 +45,7 @@ if c_cert: rv.append(c_cert) c_cert = {} elif c_cert != None: - m = value_re.match(line) + m = cert_value_re.match(line) if not m: continue key, value = m.groups() if key != '': @@ -49,4 +55,19 @@ else: c_value.append(value) return rv + def revision(self, id): + rv = {} + for line in utility.iter_command(self.base_command + " cat revision %s" % (pipes.quote(id))): + m = new_manifest_re.match(line) + if m: + rv['new_manifest'] = m.groups()[0] + continue + return rv + def manifest(self, id): + rv = [] + for line in utility.iter_command(self.base_command + " cat manifest %s" % (pipes.quote(id))): + m = manifest_entry_re.match(line) + if not m: continue + rv.append(m.groups()) + return rv ============================================================ --- revision.psp 9d90c20f2b587e81348902ac7891378758588b93 +++ revision.psp 17ec29c1ac742c32a69f6e71b4e4a0c17faf4e3e @@ -20,13 +20,13 @@ psp.set_error_page("error.psp") if not form.has_key('id'): - raise Exception("No ID specified.") + raise Exception("No revision ID specified.") id = form['id'] mt = Monotone(config.monotone, config.dbfile) hq = common.html_escape() -info = {'title' : "ID %s" % (hq(id))} +info = {'title' : "Revision %s" % (hq(id))} req.write(header(info)) %> @@ -49,7 +49,36 @@ %> +

Revision details

+ <% +revision = mt.revision(id) +req.write("%s" % (revision)) +%> + +

Manifest

+ +<% +if not revision.has_key('new_manifest'): +%> +

No manifest is associated with this revision.

+<% +else: + manifest = mt.manifest(revision['new_manifest']) +%> + + +<% + for id, filename in manifest: +%> + + + +<% + +%> + +<% req.write(footer(info)) %>
Filename
<%='%s' % (urllib.quote(id), hq(filename))%>