~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to graph.py

  • Committer: Aaron Bentley
  • Date: 2007-06-10 17:55:08 UTC
  • mfrom: (531.2.2 bzrtools)
  • Revision ID: aaron.bentley@utoronto.ca-20070610175508-gex1oxvmfv0qoagi
Merge whitespace cleanups

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
    for me, my_parents in ancestors.iteritems():
57
57
        if me in skip:
58
58
            continue
59
 
        new_ancestors[me] = {} 
 
59
        new_ancestors[me] = {}
60
60
        for parent in my_parents:
61
 
            new_parent = parent 
 
61
            new_parent = parent
62
62
            distance = 0
63
63
            while can_skip(new_parent, descendants, ancestors):
64
64
                if new_parent in exceptions:
69
69
                new_parent = list(ancestors[new_parent])[0]
70
70
                distance += 1
71
71
            new_ancestors[me][new_parent] = distance
72
 
    return new_ancestors    
 
72
    return new_ancestors
73
73
 
74
74
def get_rev_info(rev_id, source):
75
75
    """Return the committer, message, and date of a revision."""
126
126
            self.common = []
127
127
 
128
128
        self.n_history = branch.revision_history()
129
 
        self.distances = node_distances(self.descendants, self.ancestors, 
 
129
        self.distances = node_distances(self.descendants, self.ancestors,
130
130
                                        self.root)
131
131
        if other_branch is not None:
132
132
            self.base = select_farthest(self.distances, self.common)
133
 
            self.m_history = other_branch.revision_history() 
 
133
            self.m_history = other_branch.revision_history()
134
134
        else:
135
135
            self.base = None
136
136
            self.m_history = []
175
175
            color = "#33ff99"
176
176
 
177
177
        label = [name]
178
 
        committer, message, nick, date = get_rev_info(node, 
 
178
        committer, message, nick, date = get_rev_info(node,
179
179
                                                      self.branch.repository)
180
180
        if committer is not None:
181
181
            label.append(committer)
192
192
        else:
193
193
            rank = None
194
194
 
195
 
        d_node = Node("n%d" % num, color=color, label="\\n".join(label), 
 
195
        d_node = Node("n%d" % num, color=color, label="\\n".join(label),
196
196
                    rev_id=node, cluster=cluster, message=message,
197
197
                    date=date)
198
198
        d_node.rank = rank
201
201
            d_node.node_style.append('dotted')
202
202
 
203
203
        return d_node
204
 
       
 
204
 
205
205
    def get_relations(self, collapse=False, max_distance=None):
206
206
        dot_nodes = {}
207
207
        node_relations = []
208
208
        num = 0
209
209
        if collapse:
210
 
            visible_ancestors = compact_ancestors(self.descendants, 
 
210
            visible_ancestors = compact_ancestors(self.descendants,
211
211
                                                  self.ancestors, (self.base,))
212
212
        else:
213
213
            visible_ancestors = self.ancestors
259
259
    done = False
260
260
    if ext not in RSVG_OUTPUT_TYPES:
261
261
        antialias = False
262
 
    if antialias: 
 
262
    if antialias:
263
263
        output = list(output)
264
264
        try:
265
265
            invoke_dot_aa(output, filename, ext)