~lifeless/bzrk/trunk

« back to all changes in this revision

Viewing changes to graph.py

  • Committer: Scott James Remnant
  • Date: 2005-10-21 14:01:19 UTC
  • Revision ID: scott@netsplit.com-20051021140119-61457c5b20142bd7
try a little harder not to assign the same colour

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
        distance = distances[revid] + 1
57
57
        colour = colours[revid]
58
58
 
 
59
        found_same = False
59
60
        for parent_id in revision.parent_ids:
60
61
            # Check whether there's any point re-processing this
61
62
            if parent_id in distances and distances[parent_id] >= distance:
77
78
            # Penalise revisions a little at a fork if we think they're on
78
79
            # the same branch -- this makes the few few (at least) revisions
79
80
            # of a branch appear straight after the fork
80
 
            if same_branch(revision, parent):
 
81
            if not found_same and same_branch(revision, parent):
 
82
                found_same = True
81
83
                colours[parent_id] = colour
82
84
                if len(revision.parent_ids) > 1:
83
85
                    distances[parent_id] = distance + 10