/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to branchview/linegraph.py

  • Committer: Jelmer Vernooij
  • Date: 2008-06-29 15:47:30 UTC
  • mto: This revision was merged to the branch mainline in revision 519.
  • Revision ID: jelmer@samba.org-20080629154730-xfsotoxwkiytf0ph
Pass graph object rather than full repository to linegraph.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
from bzrlib.revision import NULL_REVISION
13
13
from bzrlib.tsort import merge_sort
14
14
 
15
 
def linegraph(repository, start_revs, maxnum, broken_line_length = None,
 
15
def linegraph(graph, start_revs, maxnum, broken_line_length = None,
16
16
              graph_data = True, mainline_only = False):
17
17
    """Produce a directed graph of a bzr repository.
18
18
 
43
43
    curved, kinked, etc.) and to pick the actual colours for each index.
44
44
    """
45
45
    
46
 
    graph = repository.get_graph()
47
46
    graph_parents = {}
48
47
    ghosts = set()
49
48
    graph_children = {}
57
56
            graph_parents[revid] = parent_revids
58
57
        for parent in parent_revids:
59
58
            graph_children.setdefault(parent, []).append(revid)
60
 
        graph_children[revid] = []
 
59
        graph_children.setdefault(revid, [])
61
60
    for ghost in ghosts:
62
61
        for ghost_child in graph_children[ghost]:
63
62
            graph_parents[ghost_child] = [p for p in graph_parents[ghost_child]