##// END OF EJS Templates
hgweb: filter graphmod.colored() output before iterating over it...
av6 -
r35407:76dcdc4e default
parent child Browse files
Show More
@@ -1228,13 +1228,12 b' def graph(web, req, tmpl):'
1228 # since hgweb graphing code is not itself lazy yet.
1228 # since hgweb graphing code is not itself lazy yet.
1229 dag = graphmod.dagwalker(web.repo, smartset.baseset(revs))
1229 dag = graphmod.dagwalker(web.repo, smartset.baseset(revs))
1230 # As we said one line above... not lazy.
1230 # As we said one line above... not lazy.
1231 tree = list(graphmod.colored(dag, web.repo))
1231 tree = list(item for item in graphmod.colored(dag, web.repo)
1232 if item[1] == graphmod.CHANGESET)
1232
1233
1233 def getcolumns(tree):
1234 def getcolumns(tree):
1234 cols = 0
1235 cols = 0
1235 for (id, type, ctx, vtx, edges) in tree:
1236 for (id, type, ctx, vtx, edges) in tree:
1236 if type != graphmod.CHANGESET:
1237 continue
1238 cols = max(cols, max([edge[0] for edge in edges] or [0]),
1237 cols = max(cols, max([edge[0] for edge in edges] or [0]),
1239 max([edge[1] for edge in edges] or [0]))
1238 max([edge[1] for edge in edges] or [0]))
1240 return cols
1239 return cols
@@ -1244,9 +1243,6 b' def graph(web, req, tmpl):'
1244
1243
1245 row = 0
1244 row = 0
1246 for (id, type, ctx, vtx, edges) in tree:
1245 for (id, type, ctx, vtx, edges) in tree:
1247 if type != graphmod.CHANGESET:
1248 continue
1249
1250 if usetuples:
1246 if usetuples:
1251 node = pycompat.bytestr(ctx)
1247 node = pycompat.bytestr(ctx)
1252 data.append({'node': node, 'vertex': vtx, 'edges': edges})
1248 data.append({'node': node, 'vertex': vtx, 'edges': edges})
General Comments 0
You need to be logged in to leave comments. Login now