mercurial/hgweb/webcommands.py
changeset 35413 76dcdc4e707b
parent 35397 b963750b125f
child 35414 27ab3150cd50
equal deleted inserted replaced
35412:e66d6e938d2d 35413:76dcdc4e707b
  1226         # We have to feed a baseset to dagwalker as it is expecting smartset
  1226         # We have to feed a baseset to dagwalker as it is expecting smartset
  1227         # object. This does not have a big impact on hgweb performance itself
  1227         # object. This does not have a big impact on hgweb performance itself
  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
  1241 
  1240 
  1242     def graphdata(usetuples):
  1241     def graphdata(usetuples):
  1243         data = []
  1242         data = []
  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})
  1253             else:
  1249             else:
  1254                 entry = webutil.commonentry(web.repo, ctx)
  1250                 entry = webutil.commonentry(web.repo, ctx)