# # # patch "static/viewmtn.js" # from [07b802e056bca7922f969311057df3aac66938c7] # to [0a5db3bc129d2c2a96cdbed2fb35dc7e065cfc17] # # patch "viewmtn.py" # from [01dc582e6e292d4f11ce0a526a4f143d13169d48] # to [be2566f22b012e9d6299c4eb6e842279056f16a1] # ============================================================ --- static/viewmtn.js 07b802e056bca7922f969311057df3aac66938c7 +++ static/viewmtn.js 0a5db3bc129d2c2a96cdbed2fb35dc7e065cfc17 @@ -22,7 +22,7 @@ function installCallbacks() var elems = getElementsByTagAndClassName(null, "RevisionLink"); map(cbinst, elems); - var elems = getElementsByTagAndClassName(null, "ManifestLink"); + var elems = getElementsByTagAndClassName(null, "DirLink"); map(cbinst, elems); theBox = $("popupBox"); @@ -39,7 +39,7 @@ function updatePopup(boundTo, className) if (jsonData.type == "branch") { info = "branch changed " + jsonData.ago + " ago by " + jsonData.author; } else if (jsonData.type == "revision") { - info = jsonData.ago + " ago by " + jsonData.author; + info = "revision made " + jsonData.ago + " ago by " + jsonData.author; } else if (jsonData.type == "manifest") { info = "manifest contains " + jsonData.file_count + " files in " + jsonData.directory_count + " directories."; } else { ============================================================ --- viewmtn.py 01dc582e6e292d4f11ce0a526a4f143d13169d48 +++ viewmtn.py be2566f22b012e9d6299c4eb6e842279056f16a1 @@ -133,6 +133,7 @@ class RevisionLink(Link): else: subpage = "info" Link.__init__(*(self, ), **kwargs) + self.json_args = [str(revision)] self.relative_uri = 'revision/%s/%s' % (subpage, revision) self.description = revision.abbrev() @@ -942,6 +943,16 @@ class Json: return web.notfound() class Json: + def fill_from_certs(self, rv, certs): + for cert in certs: + if cert[4] != 'name': + continue + if cert[5] == 'author': + rv['author'] = cert[7] + if cert[5] == 'date': + revdate = common.parse_timecert(cert[7]) + rv['ago'] = common.ago(revdate) + def BranchLink(self, for_branch): rv = { 'type' : 'branch', @@ -953,15 +964,18 @@ class Json: return web.notfound() changes, new_starting_point = changes for rev, certs in changes: - for cert in certs: - if cert[4] != 'name': - continue - if cert[5] == 'author': - rv['author'] = cert[7] - if cert[5] == 'date': - revdate = common.parse_timecert(cert[7]) - rv['ago'] = common.ago(revdate) + self.fill_from_certs(rv, certs) return rv + + def RevisionLink(self, revision_id): + rv = { + 'type' : 'revision', + 'revision_id' : revision_id, + } + rev = mtn.Revision(revision_id) + certs = ops.certs(rev) + self.fill_from_certs(rv, certs) + return rv def GET(self, method, encoded_args): writer = json.JsonWriter()