/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 viz/linegraph.py

  • Committer: Jelmer Vernooij
  • Date: 2007-10-31 02:11:04 UTC
  • Revision ID: jelmer@samba.org-20071031021104-sivvm8lfgam8l1xt
Use repository instead of branch in more places, to make it easier to support multiple branches in viz.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
12
12
from bzrlib.tsort import merge_sort
13
13
 
14
 
def linegraph(branch, start, maxnum):
15
 
    """Produce a directed graph of a bzr branch.
 
14
def linegraph(repository, start, maxnum):
 
15
    """Produce a directed graph of a bzr repository.
16
16
 
17
17
    Returns a tuple of (line_graph, revid_index, columns_len) where
18
18
    * line_graph is a list of tuples of (revid,
44
44
    # FIXME: This should be configurable
45
45
    BROKEN_LINE_LENGTH = 32
46
46
    
47
 
    # We get the mainline so we can pass it to merge_sort to make merge_sort
48
 
    # run faster.
49
 
    mainline = [None]
50
 
    mainline.extend(branch.revision_history())
51
 
    graph_parents = branch.repository.get_revision_graph(start)
 
47
    graph_parents = repository.get_revision_graph(start)
52
48
    graph_children = {}
53
49
    for revid in graph_parents.iterkeys():
54
50
        graph_children[revid] = []
56
52
    merge_sorted_revisions = merge_sort(
57
53
        graph_parents,
58
54
        start,
59
 
        mainline,
60
55
        generate_revno=True)
61
56
    
62
57
    revid_index = {}