~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to graph.py

  • Committer: Aaron Bentley
  • Date: 2005-09-19 05:28:47 UTC
  • Revision ID: aaron.bentley@utoronto.ca-20050919052847-85d0324a796e8fdc
Restored old graph-ancestry functionality

Show diffs side-by-side

added added

removed removed

Lines of Context:
110
110
        lines = new_lines
111
111
    node_relations = []
112
112
 
 
113
    for node in nodes.itervalues():
 
114
        node.label = node.get_label()
113
115
    if collapse:
114
116
        visible_descendants = compact_descendants(descendants, ancestors)
115
117
    else:
192
194
    return node_relations
193
195
 
194
196
 
195
 
def write_ancestry_file(branch, filename, collapse=True, antialias=True):
 
197
def write_ancestry_file(branch, filename, collapse=True, antialias=True,
 
198
                        merge_branch=None):
196
199
    b = Branch.open_containing(branch)
197
 
    relations = graph_merge_pick(b, b)
 
200
    if merge_branch is None:
 
201
        relations = graph_ancestry(b, collapse)
 
202
    else:
 
203
        m = Branch.open_containing(branch)
 
204
        relations = graph_merge_pick(b, m)
 
205
 
198
206
    ext = filename.split('.')[-1]
199
207
    if antialias and ext in ('png', 'jpg'):
200
208
        try: