# # # patch "monotone.py" # from [a76830fa185c42b3cb0535e37024037ad6a9fd63] # to [09c662fae30bad495524b25d088727ca98633092] # # patch "viewmtn.css" # from [191628c6def3f60fb8cdb729ede26c3420f4c5d5] # to [a9a4dc011f4577f9d8526536dcfb4af777c06028] # # patch "viewmtn.js" # from [6a12619346e525c61942361704f78173e55d3499] # to [b36f4e737e9b054f563c320becbc74d7a4c1df48] # # patch "wrapper.py" # from [6ec8f71424b4ca0780d9733ac5ce45c0fb771cd8] # to [6f866770c63c39c45e36479bf0c859f6add8c28f] # ============================================================ --- monotone.py a76830fa185c42b3cb0535e37024037ad6a9fd63 +++ monotone.py 09c662fae30bad495524b25d088727ca98633092 @@ -207,7 +207,8 @@ if type(ids) == type(""): ids = [ids] error, result = self.automate.run('ancestors', ids) if error != 0: - raise Exception("Unable to get ancestors of %s: %s" % (id, result)) + raise Exception("Unable to get ancestors of %s: %s" % (str(ids), + result)) else: return filter(None, result.split('\n')) def toposort(self, ids): ============================================================ --- viewmtn.css 191628c6def3f60fb8cdb729ede26c3420f4c5d5 +++ viewmtn.css a9a4dc011f4577f9d8526536dcfb4af777c06028 @@ -82,4 +82,5 @@ border-color: black; background-color: #d0d0f0; padding: 2px; + z-index: 10; } ============================================================ --- viewmtn.js 6a12619346e525c61942361704f78173e55d3499 +++ viewmtn.js b36f4e737e9b054f563c320becbc74d7a4c1df48 @@ -21,6 +21,9 @@ var elems = getElementsByTagAndClassName(null, "revisionLink"); map(cbinst, elems); + var elems = getElementsByTagAndClassName(null, "manifestLink"); + map(cbinst, elems); + theBox = $("popupBox"); } @@ -36,6 +39,8 @@ info = "branch last updated " + jsonData.ago + " by " + jsonData.author; } else if (jsonData.type == "revision") { info = jsonData.ago + " ago by " + jsonData.author; + } else if (jsonData.type == "manifest") { + info = "manifest contains " + jsonData.file_count + " files in " + jsonData.directory_count + " directories."; } else { info = "unknown type: " + jsonData.type; } ============================================================ --- wrapper.py 6ec8f71424b4ca0780d9733ac5ce45c0fb771cd8 +++ wrapper.py 6f866770c63c39c45e36479bf0c859f6add8c28f @@ -90,18 +90,31 @@ if most_recent_change == None or this_change > most_recent_change: most_recent_change = this_change most_recent_change_certs = certs - if most_recent_change != None: ago = ago_string(most_recent_change, now) + ' ago' last_author = common.extract_cert_from_certs(most_recent_change_certs, "author") or '' else: ago = '' - rv['ago'] = ago rv['author'] = last_author + elif class_name == "manifestLink": + rv['type'] = 'manifest' + revision = mt.revision(query['id']) + if revision.has_key('new_manifest'): + manifest_id = revision['new_manifest'][0][1] + manifest = mt.manifest(manifest_id) + dir_seen = {} # would use a set, but need python2.4 really + for file_id, filename in manifest: + fsp = filename.rsplit('/', 1) + if len(fsp) == 2 and not dir_seen.has_key(fsp[1]): + dir_seen[fsp[1]] = True + rv['file_count'] = len(manifest) + rv['directory_count'] = len(dir_seen.keys()) + 1 # root dir + else: + rv['file_count'] = 0 + rv['directory_count'] = 0 - rv['hint'] = query req.write(writer.write(rv)) return apache.OK