Rev 3403: Found a graph leak. in http://bzr.arbash-meinel.com/branches/bzr/1.4-dev/find_unique_ancestors

John Arbash Meinel john at arbash-meinel.com
Fri Apr 25 01:41:37 BST 2008


At http://bzr.arbash-meinel.com/branches/bzr/1.4-dev/find_unique_ancestors

------------------------------------------------------------
revno: 3403
revision-id: john at arbash-meinel.com-20080425003535-l6a6okvcdhn8f2sj
parent: john at arbash-meinel.com-20080424233649-xyyjic178u9zuidd
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: find_unique_ancestors
timestamp: Thu 2008-04-24 19:35:35 -0500
message:
  Found a graph leak.
  
  Needed set.update() rather than set =
  The results were still correct, but it would generally cause
  a large leak into the rest of the graph.
modified:
  bzrlib/graph.py                graph_walker.py-20070525030359-y852guab65d4wtn0-1
  bzrlib/tests/test_graph.py     test_graph_walker.py-20070525030405-enq4r60hhi9xrujc-1
-------------- next part --------------
=== modified file 'bzrlib/graph.py'
--- a/bzrlib/graph.py	2008-04-24 22:17:18 +0000
+++ b/bzrlib/graph.py	2008-04-25 00:35:35 +0000
@@ -253,7 +253,7 @@
             if unique_are_common_nodes:
                 ancestors = unique_searcher.find_seen_ancestors(
                                 unique_are_common_nodes)
-                ancestors = common_searcher.find_seen_ancestors(ancestors)
+                ancestors.update(common_searcher.find_seen_ancestors(ancestors))
                 unique_searcher.stop_searching_any(ancestors)
                 common_searcher.start_searching(ancestors)
 

=== modified file 'bzrlib/tests/test_graph.py'
--- a/bzrlib/tests/test_graph.py	2008-04-24 23:36:49 +0000
+++ b/bzrlib/tests/test_graph.py	2008-04-25 00:35:35 +0000
@@ -1102,6 +1102,8 @@
         self.assertFindUniqueAncestors(graph, ['h'], 'h', ['i'])
         self.assertFindUniqueAncestors(graph, ['e', 'g', 'i'], 'i', ['h'])
 
+        self.assertFindUniqueAncestors(graph, ['h'], 'h', ['j'])
+
     def test_in_ancestry(self):
         graph = self.make_graph(ancestry_1)
         self.assertFindUniqueAncestors(graph, [], 'rev1', ['rev3'])



More information about the bazaar-commits mailing list