# # # patch "monotone.py" # from [bbcdd36f0094c2e02895fa0aaa28ddf97fe51b3d] # to [092c7c78be0f9ce11001a38f55e8599e9f1ac21b] # # patch "revision.psp" # from [76c02a4a88e67393f51ae5f3ca99aa9dcba877f9] # to [616426403379fe278771f069617978280fd8041a] # ============================================================ --- monotone.py bbcdd36f0094c2e02895fa0aaa28ddf97fe51b3d +++ monotone.py 092c7c78be0f9ce11001a38f55e8599e9f1ac21b @@ -117,13 +117,14 @@ if entry: rv.append(entry) return rv def ancestry_graph(self, graphdir, graphuri, id, limit=0): + graph_id = "%s.%d" % (id, limit) rv = { - 'dot_file' : os.path.join(graphdir, id + ".dot"), - 'image_file' : os.path.join(graphdir, id + ".png"), - 'imagemap_file' : os.path.join(graphdir, id + ".html"), - 'dot_uri' : "%s/%s.dot" % (graphuri, urllib.quote(id)), - 'image_uri' : "%s/%s.png" % (graphuri, urllib.quote(id)), - 'imagemap_uri' : "%s/%s.html" % (graphuri, urllib.quote(id)), + 'dot_file' : os.path.join(graphdir, graph_id + ".dot"), + 'image_file' : os.path.join(graphdir, graph_id + ".png"), + 'imagemap_file' : os.path.join(graphdir, graph_id + ".html"), + 'dot_uri' : "%s/%s.dot" % (graphuri, urllib.quote(graph_id)), + 'image_uri' : "%s/%s.png" % (graphuri, urllib.quote(graph_id)), + 'imagemap_uri' : "%s/%s.html" % (graphuri, urllib.quote(graph_id)), } missing = filter(lambda x: x != True, map(lambda x: os.access(x, os.R_OK), rv.values())) if len(missing) == 0: ============================================================ --- revision.psp 76c02a4a88e67393f51ae5f3ca99aa9dcba877f9 +++ revision.psp 616426403379fe278771f069617978280fd8041a @@ -32,13 +32,20 @@ info = {'title' : "Revision %s" % (hq(id))} req.write(header(info)) -ancestry_graph = mt.ancestry_graph(config.graphdir, config.graphuri, id, 20) +ancestry_limit = 15 +ancestry_maximum = 500 +try: + if form.has_key('ancestry_limit'): + ancestry_limit = int(form['ancestry_limit']) +except: pass +if ancestry_limit == 0 or ancestry_limit > ancestry_maximum: + ancestry_limit = ancestry_maximum + +ancestry_graph = mt.ancestry_graph(config.graphdir, config.graphuri, id, ancestry_limit) req.write(open(ancestry_graph['imagemap_file']).read()) %> - -