Rev 3484: change the name a bit in http://bzr.arbash-meinel.com/branches/bzr/1.6-dev/lazy_revno

John Arbash Meinel john at arbash-meinel.com
Tue Jun 17 00:01:20 BST 2008


At http://bzr.arbash-meinel.com/branches/bzr/1.6-dev/lazy_revno

------------------------------------------------------------
revno: 3484
revision-id: john at arbash-meinel.com-20080616230102-0hh8shi6eytjneqp
parent: john at arbash-meinel.com-20080616223912-e8lkrvyhgzveif90
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: lazy_revno
timestamp: Mon 2008-06-16 18:01:02 -0500
message:
  change the name a bit
-------------- next part --------------
=== modified file 'bzrlib/graph.py'
--- a/bzrlib/graph.py	2008-06-16 22:39:12 +0000
+++ b/bzrlib/graph.py	2008-06-16 23:01:02 +0000
@@ -1490,7 +1490,7 @@
         if node.revno is not None:
             return node.revno
         # This just means that we need to start searching
-        self._find_boundary_revisions(node)
+        mainline_node = self._find_mainline_ancestor(node)
         # We might have done enough work to know the revno now, do a quick
         # check
         if node.revno is not None:
@@ -1502,12 +1502,17 @@
                 node = self._get_node(p_id)
                 node.known_children.add(revision_id)
 
-    def _find_boundary_revisions(self, node):
+    def _find_mainline_ancestor(self, node):
         """Walk backwards until we find the mainline revision we descend from.
 
         This walks the left-hand parent of both the mainline and the
         revision_id until we find the point at which they converge, reach
         NULL_REVISION, or a ghost.
+
+        :param node: Find the ancestor of this node that lies on the mainline
+            from self._tip_revision_id
+        :return: a _LazyRevnoNode left-hand ancestor of node which is
+            in the branch mainline
         """
         next_parent_request = set()
         # Have we finished walking the mainline?

=== modified file 'bzrlib/tests/test_graph.py'
--- a/bzrlib/tests/test_graph.py	2008-06-16 22:39:12 +0000
+++ b/bzrlib/tests/test_graph.py	2008-06-16 23:01:02 +0000
@@ -1380,12 +1380,13 @@
         mapper = self.make_mapper(ancestry_1, 'rev4', break_on=['rev1'])
         self.assertEqual(3, mapper.get_dotted_revno('rev3'))
 
-    def test__find_boundary_revisions_stops(self):
+    def test__find_mainline_ancestor_stops(self):
         """Ensure we stop iterating ancestry when we can."""
         mapper = self.make_mapper(with_tail, 'i', break_on=['a', 'b'])
         # The node walker should reach mainline before the mainline walker
         # does. We should still be able to stop early
-        node = mapper._find_boundary_revisions(mapper._get_node('g'))
+        node = mapper._find_mainline_ancestor(mapper._get_node('g'))
         # The common point is 'e'
         self.assertEqual('e', node.revision_id)
         self.assertEqual(5, node.revno)
+        # We should have enqueued the nodes that we visited



More information about the bazaar-commits mailing list