/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 19:34:29 UTC
  • mto: This revision was merged to the branch mainline in revision 520.
  • Revision ID: jelmer@samba.org-20080629193429-ir2ilmbko6qkubg5
Add Branch/Index option if bzr-search is available.

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
    
46
46
    graph = repository.get_graph()
47
47
    graph_parents = {}
 
48
    ghosts = set()
48
49
    graph_children = {}
49
50
    for (revid, parent_revids) in graph.iter_ancestry(start_revs):
 
51
        if parent_revids is None:
 
52
            ghosts.add(revid)
 
53
            continue
50
54
        if parent_revids == (NULL_REVISION,):
51
55
            graph_parents[revid] = ()
52
56
        else:
53
57
            graph_parents[revid] = parent_revids
54
 
        graph_children[revid] = []
55
 
 
 
58
        for parent in parent_revids:
 
59
            graph_children.setdefault(parent, []).append(revid)
 
60
        graph_children.setdefault(revid, [])
 
61
    for ghost in ghosts:
 
62
        for ghost_child in graph_children[ghost]:
 
63
            graph_parents[ghost_child] = [p for p in graph_parents[ghost_child]
 
64
                                          if p not in ghosts]
56
65
    graph_parents["top:"] = start_revs
57
66
 
58
67
    if len(graph_parents)>0:
94
103
        revid_index[revid] = rev_index
95
104
        
96
105
        parents = graph_parents[revid]
97
 
        for parent_revid in parents:
98
 
            graph_children[parent_revid].append(revid)
99
 
        
100
106
        linegraph.append([revid,
101
107
                          None,
102
108
                          [],