# # # patch "monotone.py" # from [092c7c78be0f9ce11001a38f55e8599e9f1ac21b] # to [36343c9a6b03e403f7d39b3a305f0cad05a3fa43] # # patch "revision.psp" # from [fdfeca68da35d680fa174719f9e759d63eda2657] # to [c36c7b35a37cfa813914867e19cccdf7dc65dfed] # ============================================================ --- monotone.py 092c7c78be0f9ce11001a38f55e8599e9f1ac21b +++ monotone.py 36343c9a6b03e403f7d39b3a305f0cad05a3fa43 @@ -17,9 +17,7 @@ dash_re = re.compile(r'^-+$') cert_value_re = re.compile(r'^(\S*) *: (.*)$') -new_manifest_re = re.compile(r'^new_manifest \[(\S+)\]$') -old_revision_re = re.compile(r'^old_revision \[(\S+)\]$') -old_manifest_re = re.compile(r'^old_manifest \[(\S+)\]$') +basic_io_re = re.compile(r'^ *(\S+) [\"\[](.*)[\"\]]$') manifest_entry_re = re.compile(r'^(\S+) *(.*)$') @@ -78,11 +76,18 @@ return rv def revision(self, id): rv = {} + cv = [] 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] + if not line: + if len(cv) != 0: + stanza_type = cv[0][0] + if not rv.has_key(stanza_type): rv[stanza_type] = [] + rv[stanza_type].append(cv) + cv = [] continue + m = basic_io_re.match(line) + if not m: continue + cv.append(m.groups()) return rv def manifest(self, id): rv = [] ============================================================ --- revision.psp fdfeca68da35d680fa174719f9e759d63eda2657 +++ revision.psp c36c7b35a37cfa813914867e19cccdf7dc65dfed @@ -63,9 +63,32 @@

Revision details

+ <% revision = mt.revision(id) +for key in revision.keys(): + value = "" + for stanza in revision[key]: + type = stanza[0][0] + if type == "patch": + fname, from_id, to_id = stanza[0][1], stanza[1][1], stanza[2][1] + value += 'Patch file %s from %s to %s (diff)
' % (hq(fname), urllib.quote(from_id), hq(from_id), urllib.quote(to_id), hq(to_id), urllib.quote(from_id), urllib.quote(to_id)) + elif type == "old_revision": + old_revision, old_manifest = stanza[0][1], stanza[1][1] + value += 'Old revision is: %s
Old manifest: %s' % (urllib.quote(old_revision), hq(old_revision), hq(old_manifest)) + elif type == "new_manifest": + new_manifest = stanza[0][1] + value += 'New manifest is: %s' % (hq(old_manifest)) + elif type == "add_file": + new_file = stanza[0][1] + value += "Add file: %s
" % (hq(new_file)) + elif type == "delete_file": + delete_file = stanza[0][1] + value += "Delete file: %s
" % (hq(delete_file)) + req.write('' % (hq(key), value)) + %> +
%s%s

Not yet implemented. Feel like writing a parser for monotone cat revision? :-) @@ -110,8 +133,10 @@

No manifest is associated with this revision.

<% else: - gettar='gettar.py?id=%s' % (urllib.quote(revision['new_manifest'])) - manifest = mt.manifest(revision['new_manifest']) + # ugh, need to wrap things nicer + manifest_id = revision['new_manifest'][0][0][1] + manifest = mt.manifest(manifest_id) + gettar='gettar.py?id=%s' % (urllib.quote(manifest_id)) %>
Filename