[Pkg-bazaar-commits] ./bzr-gtk/unstable r472: Merged Aaron's ghost handling fix.

Daniel Schierbeck daniel.schierbeck at gmail.com
Fri Apr 10 07:50:26 UTC 2009


------------------------------------------------------------
revno: 472
committer: Daniel Schierbeck <daniel.schierbeck at gmail.com>
branch nick: trunk
timestamp: Mon 2008-04-28 23:42:32 +0200
message:
  Merged Aaron's ghost handling fix.
modified:
  branchview/linegraph.py
    ------------------------------------------------------------
    revno: 471.1.1
    committer: Aaron Bentley <aaron at aaronbentley.com>
    branch nick: bzr-gtk
    timestamp: Mon 2008-04-28 17:20:43 -0400
    message:
      Get viz working on graphs with ghosts
    modified:
      branchview/linegraph.py
    ------------------------------------------------------------
    revno: 471.1.2
    committer: Aaron Bentley <aaron at aaronbentley.com>
    branch nick: bzr-gtk
    timestamp: Mon 2008-04-28 17:27:02 -0400
    message:
      Turn my_graph_children into plain graph_children
    modified:
      branchview/linegraph.py
-------------- next part --------------
=== modified file 'branchview/linegraph.py'
--- a/branchview/linegraph.py	2008-04-25 19:54:56 +0000
+++ b/branchview/linegraph.py	2008-04-28 21:27:02 +0000
@@ -45,14 +45,24 @@
     
     graph = repository.get_graph()
     graph_parents = {}
+    ghosts = set()
+    graph_children = {}
     graph_children = {}
     for (revid, parent_revids) in graph.iter_ancestry(start_revs):
+        if parent_revids is None:
+            ghosts.add(revid)
+            continue
         if parent_revids == (NULL_REVISION,):
             graph_parents[revid] = ()
         else:
             graph_parents[revid] = parent_revids
+        for parent in parent_revids:
+            graph_children.setdefault(parent, []).append(revid)
         graph_children[revid] = []
-
+    for ghost in ghosts:
+        for ghost_child in graph_children[ghost]:
+            graph_parents[ghost_child] = [p for p in graph_parents[ghost_child]
+                                          if p not in ghosts]
     graph_parents["top:"] = start_revs
 
     if len(graph_parents)>0:
@@ -94,9 +104,6 @@
         revid_index[revid] = rev_index
         
         parents = graph_parents[revid]
-        for parent_revid in parents:
-            graph_children[parent_revid].append(revid)
-        
         linegraph.append([revid,
                           None,
                           [],



More information about the Pkg-bazaar-commits mailing list