[Pkg-bazaar-commits] ./bzr-gtk/unstable r18: try a little harder not to assign the same colour

Scott James Remnant scott at netsplit.com
Fri Apr 10 07:15:28 UTC 2009


------------------------------------------------------------
revno: 18
committer: Scott James Remnant <scott at netsplit.com>
timestamp: Fri 2005-10-21 15:01:19 +0100
message:
  try a little harder not to assign the same colour
modified:
  graph.py
-------------- next part --------------
=== modified file 'graph.py'
--- a/graph.py	2005-10-17 04:26:00 +0000
+++ b/graph.py	2005-10-21 14:01:19 +0000
@@ -56,6 +56,7 @@
         distance = distances[revid] + 1
         colour = colours[revid]
 
+        found_same = False
         for parent_id in revision.parent_ids:
             # Check whether there's any point re-processing this
             if parent_id in distances and distances[parent_id] >= distance:
@@ -77,7 +78,8 @@
             # Penalise revisions a little at a fork if we think they're on
             # the same branch -- this makes the few few (at least) revisions
             # of a branch appear straight after the fork
-            if same_branch(revision, parent):
+            if not found_same and same_branch(revision, parent):
+                found_same = True
                 colours[parent_id] = colour
                 if len(revision.parent_ids) > 1:
                     distances[parent_id] = distance + 10



More information about the Pkg-bazaar-commits mailing list