Rev 86: Fix some uses of get_revision_graph(). in file:///data/jelmer/bzr-rebase/trunk/

Jelmer Vernooij jelmer at samba.org
Thu May 29 13:14:16 BST 2008


At file:///data/jelmer/bzr-rebase/trunk/

------------------------------------------------------------
revno: 86
revision-id: jelmer at samba.org-20080529121416-ycd19g48oy3bxxc5
parent: jelmer at samba.org-20080518144701-moplzmp1nr504zzc
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: trunk
timestamp: Thu 2008-05-29 14:14:16 +0200
message:
  Fix some uses of get_revision_graph().
modified:
  __init__.py                    __init__.py-20070626215909-fi0s39bkwxn4gcto-1
  test_rebase.py                 test_rebase.py-20070626221123-ellanmf93nw8z9r1-2
=== modified file '__init__.py'
--- a/__init__.py	2008-05-18 14:47:01 +0000
+++ b/__init__.py	2008-05-29 12:14:16 +0000
@@ -203,7 +203,7 @@
             replace_map = generate_simple_plan(
                     revhistory, start_revid, stop_revid, onto,
                     wt.branch.repository.get_ancestry(onto),
-                    wt.branch.repository.revision_parents,
+                    wt.branch.repository.get_graph(),
                     lambda revid: regenerate_default_revid(wt.branch.repository, revid),
                     not always_rebase_merges
                     )

=== modified file 'test_rebase.py'
--- a/test_rebase.py	2008-05-11 18:52:36 +0000
+++ b/test_rebase.py	2008-05-29 12:14:16 +0000
@@ -17,7 +17,7 @@
 
 from bzrlib.conflicts import ConflictList
 from bzrlib.errors import UnknownFormatError, NoSuchFile, ConflictsInTree
-from bzrlib.graph import Graph
+from bzrlib.graph import Graph, DictParentsProvider
 from bzrlib.revision import NULL_REVISION
 from bzrlib.tests import TestCase, TestCaseWithTransport
 from bzrlib.trace import mutter
@@ -104,7 +104,7 @@
                 generate_simple_plan(b.revision_history(), "bla2", None, 
                     "bloe", 
                     ["bloe", "bla"],
-                    b.repository.revision_parents, 
+                    b.repository.get_graph(), 
                     lambda y: "new"+y))
         b.repository.unlock()
      
@@ -127,7 +127,7 @@
         self.assertEquals({'bla2': ('newbla2', ["bloe"]), 'bla3': ('newbla3', ['newbla2'])}, 
                 generate_simple_plan(b.revision_history(), "bla2", None, "bloe", 
                     ["bloe", "bla"],
-                    b.repository.revision_parents,
+                    b.repository.get_graph(),
                     lambda y: "new"+y))
         b.repository.unlock()
  
@@ -194,16 +194,17 @@
         E -> (E', [D', C])
         """
         parents_map = {
-                "A": [],
-                "B": ["A"],
-                "C": ["B"],
-                "D": ["A"],
-                "E": ["D", "B"]
+                "A": (),
+                "B": ("A",),
+                "C": ("B",),
+                "D": ("A",),
+                "E": ("D", "B")
         }
-        self.assertEquals({"D": ("D'", ["C"]), "E": ("E'", ["D'"])}, 
+        graph = Graph(DictParentsProvider(parents_map))
+        self.assertEquals({"D": ("D'", ["C"]), "E": ("E'", ("D'",))}, 
                 generate_simple_plan(["A", "D", "E"], 
                                      "D", None, "C", ["A", "B", "C"], 
-                    parents_map.get, lambda y: y+"'"))
+                    graph, lambda y: y+"'"))
 
     def test_plan_with_already_merged_skip_merges(self):
         """We need to use a merge base that makes sense. 
@@ -223,16 +224,17 @@
         D -> (D', [C])
         """
         parents_map = {
-                "A": [],
-                "B": ["A"],
-                "C": ["B"],
-                "D": ["A"],
-                "E": ["D", "B"]
+                "A": (),
+                "B": ("A",),
+                "C": ("B",),
+                "D": ("A",),
+                "E": ("D", "B")
         }
+        graph = Graph(DictParentsProvider(parents_map))
         self.assertEquals({"D": ("D'", ["C"])}, 
                 generate_simple_plan(["A", "D", "E"], 
                                      "D", None, "C", ["A", "B", "C"], 
-                    parents_map.get, lambda y: y+"'", True))
+                    graph, lambda y: y+"'", True))
  
 
 class PlanFileTests(TestCaseWithTransport):




More information about the bazaar-commits mailing list