# HG changeset patch # User Mads Kiilerich # Date 1386700237 -3600 # Node ID b20330417f57f832ad6412b64e623eb2daaeb2dd # Parent efc911d7b2170f0cde7bf5da95036f57ab68a27e graph: stop looking for ancestors that have been passed - showing it as a "dead end" is better when the repo is very branchy diff -r efc911d7b217 -r b20330417f57 kallithea/lib/graphmod.py --- a/kallithea/lib/graphmod.py Tue Dec 10 19:30:37 2013 +0100 +++ b/kallithea/lib/graphmod.py Tue Dec 10 19:30:37 2013 +0100 @@ -31,7 +31,8 @@ while pending: r = pending.pop() if r < minrev: - pass + if r > nullrev: # ignore -1 returned from parentrev_func + ancestors.add(-head) # fake unique unknown parent for this rev elif r in knownrevs: ancestors.add(r) elif r not in seen: @@ -106,12 +107,17 @@ colors[rev] = newcolor newcolor += 1 - nextrow = row[:] + col = row.index(rev) + addparents = [p for p in dagparents if p not in row] # Add unknown parents to nextrow - addparents = [p for p in dagparents if p not in nextrow] - col = nextrow.index(rev) - nextrow[col:col + 1] = addparents + tmprow = row[:] + tmprow[col:col + 1] = addparents + # Stop looking for non-existing ancestors + nextrow = [] + for r in tmprow: + if r > nullrev or r in dagparents: + nextrow.append(r) # Set colors for the parents color = colors.pop(rev)