~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/graph.py

  • Committer: Aaron Bentley
  • Date: 2005-09-10 19:44:52 UTC
  • mto: (1185.3.4)
  • mto: This revision was merged to the branch mainline in revision 1390.
  • Revision ID: aaron.bentley@utoronto.ca-20050910194452-1dfd6ae1a5d52aa6
Added farthest_node sanity checks

Show diffs side-by-side

added added

removed removed

Lines of Context:
166
166
    while len(lines) > 0:
167
167
        new_lines = set()
168
168
        for line in lines:
 
169
            assert line not in graph[line], "%s refers to itself" % line
169
170
            for descendant in graph[line]:
170
171
                distance = max_distance(descendant, ancestors, distances)
171
172
                if distance is None:
178
179
        return distances[n]
179
180
    node_list = distances.keys()
180
181
    node_list.sort(key=by_distance, reverse=True)
 
182
    assert len(node_list) == len(graph), "%d nodes missing" % \
 
183
        (len(graph) - len(node_list)) 
181
184
    return node_list