Rev 509: Deal with the undefined branching scheme, for backwards compatibility. in file:///data/jelmer/bzr-svn/0.4/

Jelmer Vernooij jelmer at samba.org
Thu Jul 12 09:28:34 BST 2007


At file:///data/jelmer/bzr-svn/0.4/

------------------------------------------------------------
revno: 509
revision-id: jelmer at samba.org-20070704212352-kodoe5uul8r47fqz
parent: jelmer at samba.org-20070704170231-asdxu22i79f8k9lo
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: main
timestamp: Wed 2007-07-04 23:23:52 +0200
message:
  Deal with the undefined branching scheme, for backwards compatibility.
modified:
  tests/test_upgrade.py          test_upgrade.py-20070106170128-64zt3eqggg4tng1c-1
  upgrade.py                     upgrade.py-20070106192108-0rakplee2lzah4gs-1
=== modified file 'tests/test_upgrade.py'
--- a/tests/test_upgrade.py	2007-07-04 14:21:27 +0000
+++ b/tests/test_upgrade.py	2007-07-04 21:23:52 +0000
@@ -38,7 +38,11 @@
 
 class ParserTests(TestCase):
     def test_current(self):
-        self.assertEqual(("uuid", "trunk", 1, "undefined", 3), 
+        self.assertEqual(("uuid", "trunk", 1, "trunk0", 3), 
+                parse_legacy_revision_id("svn-v3-trunk0:uuid:trunk:1"))
+
+    def test_current_undefined(self):
+        self.assertEqual(("uuid", "trunk", 1, None, 3), 
                 parse_legacy_revision_id("svn-v3-undefined:uuid:trunk:1"))
 
     def test_legacy2(self):

=== modified file 'upgrade.py'
--- a/upgrade.py	2007-07-04 17:02:31 +0000
+++ b/upgrade.py	2007-07-04 21:23:52 +0000
@@ -58,6 +58,8 @@
         return (uuid, branch_path, revnum, None, 2)
     elif revid.startswith("svn-v3-"):
         (uuid, bp, rev, scheme) = parse_svn_revision_id(revid)
+        if scheme == "undefined":
+            scheme = None
         return (uuid, bp, rev, scheme, 3)
 
     raise InvalidRevisionId(revid, None)
@@ -117,7 +119,7 @@
     :return: Dictionary of mapped revisions
     """
     try:
-        from bzrlib.plugins.rebase.rebase import change_revision_parent, generate_transpose_plan, rebase
+        from bzrlib.plugins.rebase.rebase import replay_snapshot, generate_transpose_plan, rebase
     except ImportError, e:
         raise RebaseNotPresent(e)
     needed_revs = []
@@ -171,7 +173,7 @@
         plan = generate_transpose_plan(repository, graph, rename_map, 
                                        lambda rev: create_upgraded_revid(rev.revision_id))
         mutter('rebase plan: %r' % plan)
-        rebase(repository, plan, change_revision_parent)
+        rebase(repository, plan, replay_snapshot)
         def remove_parents((oldrevid, (newrevid, parents))):
             return (oldrevid, newrevid)
         return dict(map(remove_parents, plan.items()))




More information about the bazaar-commits mailing list