Rev 4647: Add support for skipping ghost nodes. in http://bazaar.launchpad.net/~jameinel/bzr/2.0b1-stable-groupcompress-order

John Arbash Meinel john at arbash-meinel.com
Tue Aug 25 19:46:00 BST 2009


At http://bazaar.launchpad.net/~jameinel/bzr/2.0b1-stable-groupcompress-order

------------------------------------------------------------
revno: 4647
revision-id: john at arbash-meinel.com-20090825184540-6dn3xjq62xhgj2gq
parent: john at arbash-meinel.com-20090825184219-tbh5i6bvyqe6sp6e
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.0b1-stable-groupcompress-order
timestamp: Tue 2009-08-25 13:45:40 -0500
message:
  Add support for skipping ghost nodes.
-------------- next part --------------
=== modified file 'bzrlib/_known_graph_py.py'
--- a/bzrlib/_known_graph_py.py	2009-08-25 18:42:19 +0000
+++ b/bzrlib/_known_graph_py.py	2009-08-25 18:45:40 +0000
@@ -251,10 +251,9 @@
                              reverse=True)
             while pending:
                 node = pending.pop()
-                # TODO: test ghosts
-                # if node.parent_keys is None:
-                #     # Ghost node, skip it
-                #     continue
+                if node.parent_keys is None:
+                    # Ghost node, skip it
+                    continue
                 result.append(node.key)
                 for parent_key in sorted(node.parent_keys, reverse=True):
                     parent_node = self._nodes[parent_key]

=== modified file 'bzrlib/_known_graph_pyx.pyx'
--- a/bzrlib/_known_graph_pyx.pyx	2009-08-25 18:42:19 +0000
+++ b/bzrlib/_known_graph_pyx.pyx	2009-08-25 18:45:40 +0000
@@ -473,10 +473,8 @@
             pending = _sort_list_nodes(nodes, 1)
             while pending:
                 node = pending.pop()
-                # TODO: test ghosts
-                # if node.parent_keys is None:
-                #     # Ghost node, skip it
-                #     continue
+                if node.parents is None:
+                    continue
                 result.append(node.key)
                 parents = _sort_list_nodes(list(node.parents), 1)
                 for pos from 0 <= pos < PyList_GET_SIZE(parents):

=== modified file 'bzrlib/tests/test__known_graph.py'
--- a/bzrlib/tests/test__known_graph.py	2009-08-25 18:42:19 +0000
+++ b/bzrlib/tests/test__known_graph.py	2009-08-25 18:45:40 +0000
@@ -813,3 +813,7 @@
                            'e':('b', 'c', 'd'),
                            'f':('d', 'Z'),
                            })
+
+    def test_skip_ghost(self):
+        self.assertSorted(['b', 'c', 'a'],
+                          {'a':(), 'b':('a', 'ghost'), 'c':('a',)})



More information about the bazaar-commits mailing list