#
#
# add_file "templates/help.html"
# content [261b26dddeecdfc25505dc8bf5ce633c947b54d6]
#
# add_file "templates/revision.html"
# content [e9eeb6212f211ce522b1db16156e7129e00993d1]
#
# add_file "templates/revisioninfo.html"
# content [2292f6acf015523618317e0eab6dc5c708b811c5]
#
# add_file "templates/tags.html"
# content [51d40e8786b2cdfb99d956a28583be36c49cc078]
#
# patch "mtn.py"
# from [9aacc29cd3af6277ef411f7e582a450f58c727ee]
# to [7c97c5608d0dad3aa254a53e5bde4ac2fa7a83ac]
#
# patch "viewmtn.py"
# from [574970773ca270f6282d13161905dae81274170b]
# to [865eb1f4de92304160c0b28ef616299dcdb8d799]
#
============================================================
--- templates/help.html 261b26dddeecdfc25505dc8bf5ce633c947b54d6
+++ templates/help.html 261b26dddeecdfc25505dc8bf5ce633c947b54d6
@@ -0,0 +1,22 @@
+#extends base
+
+#def body
+
+ViewMTN is a web interface to the Monotone revision control
+system. These web pages provide various methods to access the data
+controlled within a particular Monotone database.
+
+
+
+To make full use of this web interface, it is recommended that you read
+the Monotone
+manual.
+
+
+
+Feature suggestions, bug reports and patches are welcome. Please go
+to the ViewMTN
+software page and follow the contact instructions there.
+
+#end def
============================================================
--- templates/revision.html e9eeb6212f211ce522b1db16156e7129e00993d1
+++ templates/revision.html e9eeb6212f211ce522b1db16156e7129e00993d1
@@ -0,0 +1,8 @@
+#extends base
+
+#def extramenu
+Revision $revision.abbrev():
+Info |
+Browse Files |
+Download (tar)
+#end def
============================================================
--- templates/revisioninfo.html 2292f6acf015523618317e0eab6dc5c708b811c5
+++ templates/revisioninfo.html 2292f6acf015523618317e0eab6dc5c708b811c5
@@ -0,0 +1,34 @@
+#extends revision
+
+#def body
+
+Certificates
+
+
+#for cert in $certs
+
+ $cert['name'] | $cert['value'] |
+
+#end for
+
+
+Revision Details
+
+
+#for stanza_type, descr, value in $revisions
+
+
+ #filter Filter
+ $descr
+ #filter WebSafe
+ |
+
+ #filter Filter
+ $value
+ #filter WebSafe
+
+ |
+#end for
+
+
+#end def
============================================================
--- templates/tags.html 51d40e8786b2cdfb99d956a28583be36c49cc078
+++ templates/tags.html 51d40e8786b2cdfb99d956a28583be36c49cc078
@@ -0,0 +1,29 @@
+#extends base
+
+#def body
+
+A tag marks a particular revision that is in some way significant.
+A common use of tags is to mark public release of a piece of software.
+To view a particular tag, select it from the list below.
+
+
+
+Tag | Signed by | When |
+#for tag in $tags
+
+
+ #filter Filter
+ $link($tag).html()
+ #filter WebSafe
+ |
+
+ $tag.author
+ |
+
+
+ |
+
+#end for
+
+
+#end def
============================================================
--- mtn.py 9aacc29cd3af6277ef411f7e582a450f58c727ee
+++ mtn.py 7c97c5608d0dad3aa254a53e5bde4ac2fa7a83ac
@@ -223,8 +223,10 @@
consumer = choose_consume
current_stanza = []
for line in gen:
-# print "read line:", [line]
- if (line == '' or line == '\n') and current_stanza:
+ # if we're not in an actual consumer (which we shouldn't be, unless
+ # we're parsing some sort of multi-line token) and we have a blank
+ # line, it indicates the end of any current stanza
+ if (consumer == choose_consume) and (line == '' or line == '\n') and current_stanza:
yield current_stanza
current_stanza = []
continue
============================================================
--- viewmtn.py 574970773ca270f6282d13161905dae81274170b
+++ viewmtn.py 865eb1f4de92304160c0b28ef616299dcdb8d799
@@ -55,6 +55,40 @@
self.relative_uri = 'branch/changes/' + hq(branch.name)
self.description = hq(branch.name)
+def certs_for_template(cert_gen):
+ for cert in cert_gen:
+ if cert[0] == 'key' and len(cert) != 10:
+ raise Exception("Not a correcly formatted certificate: %s" % cert)
+ if cert[3] != 'ok':
+ raise Exception("Certificate failed check.")
+ yield { 'key' : cert[1],
+ 'name' : cert[5],
+ 'value' : cert[7] }
+
+def revisions_for_template(rev_gen):
+ def prettify(s):
+ return ' '.join(map(lambda x: hq(x[0].upper() + x[1:]), s.replace("_", " ").split(" ")))
+
+ for stanza in rev_gen:
+ stanza_type = stanza[0]
+ description, value = prettify(stanza_type), None
+
+ if stanza_type == "format_version" or \
+ stanza_type == "new_manifest":
+ continue
+ elif stanza_type == "patch":
+ fname, from_id, to_id = stanza[1], stanza[3], stanza[5]
+ # if from_id is null, this is a new file
+ # since we're showing that information under "Add", so
+ # skip it here
+ if not from_id:
+ continue
+ else:
+ value = "(this stanza type is not explicitly rendered; please report this.)\n%s" % hq(stanza)
+
+ if description != None:
+ yield stanza_type, description, value
+
type_to_link_class = {
'tag' : TagLink,
'branch' : BranchLink
@@ -117,9 +151,13 @@
class RevisionInfo:
def GET(self, revision):
revision = mtn.Revision(revision)
+ certs = ops.certs(revision)
+ revisions = ops.get_revision(revision)
renderer.render('revisioninfo.html',
page_title="Revision %s" % revision.abbrev(),
- revision=revision)
+ revision=revision,
+ certs=certs_for_template(certs),
+ revisions=revisions_for_template(revisions))
class RevisionDiff:
def GET(self, revision_from, revision_to):