Rev 5720: (jelmer) Fix various import issues, in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Mon Mar 14 11:32:38 UTC 2011


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 5720 [merge]
revision-id: pqm at pqm.ubuntu.com-20110314113235-vkdg2umzio48zlnu
parent: pqm at pqm.ubuntu.com-20110314105224-8a5o4um4ueri4t0l
parent: jelmer at samba.org-20110313005523-0sd33sq18hgivjro
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Mon 2011-03-14 11:32:35 +0000
message:
  (jelmer) Fix various import issues,
   allow ControlDir.destroy_branch to raise UnsupportedOperation. (Jelmer
   Vernooij)
modified:
  bzrlib/bzrdir.py               bzrdir.py-20060131065624-156dfea39c4387cb
  bzrlib/controldir.py           controldir.py-20100802102926-hvtvh0uae5epuibp-1
  bzrlib/plugins/weave_fmt/__init__.py __init__.py-20110111033945-rpdtstq3e5w484wd-2
  bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
  bzrlib/tests/per_controldir_colo/test_supported.py test_supported.py-20100411192232-kawv9qu1t42gv89k-3
  bzrlib/tests/test_import_tariff.py test_import_tariff.p-20100207155145-ff9infp7goncs7zh-1
=== modified file 'bzrlib/bzrdir.py'
--- a/bzrlib/bzrdir.py	2011-03-11 20:12:16 +0000
+++ b/bzrlib/bzrdir.py	2011-03-12 21:22:14 +0000
@@ -25,8 +25,6 @@
 objects returned.
 """
 
-# TODO: Move old formats into a plugin to make this file smaller.
-
 import sys
 
 from bzrlib.lazy_import import lazy_import
@@ -59,10 +57,6 @@
     do_catching_redirections,
     local,
     )
-from bzrlib.weave import (
-    WeaveFile,
-    Weave,
-    )
 """)
 
 from bzrlib.trace import (

=== modified file 'bzrlib/controldir.py'
--- a/bzrlib/controldir.py	2011-03-11 17:09:07 +0000
+++ b/bzrlib/controldir.py	2011-03-12 21:22:14 +0000
@@ -30,7 +30,6 @@
     cleanup,
     errors,
     fetch,
-    graph,
     revision as _mod_revision,
     transport as _mod_transport,
     urlutils,

=== modified file 'bzrlib/plugins/weave_fmt/__init__.py'
--- a/bzrlib/plugins/weave_fmt/__init__.py	2011-03-11 15:36:12 +0000
+++ b/bzrlib/plugins/weave_fmt/__init__.py	2011-03-13 00:08:28 +0000
@@ -20,24 +20,27 @@
 """
 
 from bzrlib import (
-    branch,
-    bzrdir,
+    branch as _mod_branch,
     controldir,
-    repository,
+    repository as _mod_repository,
     serializer,
-    workingtree,
+    workingtree as _mod_workingtree,
+    )
+from bzrlib.bzrdir import (
+    BzrProber,
+    register_metadir,
     )
 
 # Pre-0.8 formats that don't have a disk format string (because they are
 # versioned by the matching control directory). We use the control directories
 # disk format string as a key for the network_name because they meet the
 # constraints (simple string, unique, immutable).
-repository.network_format_registry.register_lazy(
+_mod_repository.network_format_registry.register_lazy(
     "Bazaar-NG branch, format 5\n",
     'bzrlib.plugins.weave_fmt.repository',
     'RepositoryFormat5',
 )
-repository.network_format_registry.register_lazy(
+_mod_repository.network_format_registry.register_lazy(
     "Bazaar-NG branch, format 6\n",
     'bzrlib.plugins.weave_fmt.repository',
     'RepositoryFormat6',
@@ -49,19 +52,19 @@
 # needed, it's constructed directly by the BzrDir.  Non-native formats where
 # the repository is not separately opened are similar.
 
-repository.format_registry.register_lazy(
+_mod_repository.format_registry.register_lazy(
     'Bazaar-NG Repository format 7',
     'bzrlib.plugins.weave_fmt.repository',
     'RepositoryFormat7'
     )
 
-repository.format_registry.register_extra_lazy(
+_mod_repository.format_registry.register_extra_lazy(
     'bzrlib.plugins.weave_fmt.repository',
     'RepositoryFormat4')
-repository.format_registry.register_extra_lazy(
+_mod_repository.format_registry.register_extra_lazy(
     'bzrlib.plugins.weave_fmt.repository',
     'RepositoryFormat5')
-repository.format_registry.register_extra_lazy(
+_mod_repository.format_registry.register_extra_lazy(
     'bzrlib.plugins.weave_fmt.repository',
     'RepositoryFormat6')
 
@@ -75,7 +78,7 @@
     ' support checkouts or shared repositories.',
     hidden=True,
     deprecated=True)
-bzrdir.register_metadir(controldir.format_registry, 'metaweave',
+register_metadir(controldir.format_registry, 'metaweave',
     'bzrlib.plugins.weave_fmt.repository.RepositoryFormat7',
     'Transitional format in 0.8.  Slower than knit.',
     branch_format='bzrlib.branch.BzrBranchFormat5',
@@ -84,25 +87,25 @@
     deprecated=True)
 
 
-bzrdir.BzrProber.formats.register_lazy(
+BzrProber.formats.register_lazy(
     "Bazaar-NG branch, format 0.0.4\n", "bzrlib.plugins.weave_fmt.bzrdir",
     "BzrDirFormat4")
-bzrdir.BzrProber.formats.register_lazy(
+BzrProber.formats.register_lazy(
     "Bazaar-NG branch, format 5\n", "bzrlib.plugins.weave_fmt.bzrdir",
     "BzrDirFormat5")
-bzrdir.BzrProber.formats.register_lazy(
+BzrProber.formats.register_lazy(
     "Bazaar-NG branch, format 6\n", "bzrlib.plugins.weave_fmt.bzrdir",
     "BzrDirFormat6")
 
 
-branch.format_registry.register_extra_lazy(
+_mod_branch.format_registry.register_extra_lazy(
     'bzrlib.plugins.weave_fmt.branch', 'BzrBranchFormat4')
-branch.network_format_registry.register_lazy(
+_mod_branch.network_format_registry.register_lazy(
     "Bazaar-NG branch, format 6\n",
     'bzrlib.plugins.weave_fmt.branch', "BzrBranchFormat4")
 
 
-workingtree.format_registry.register_extra_lazy(
+_mod_workingtree.format_registry.register_extra_lazy(
     'bzrlib.plugins.weave_fmt.workingtree',
     'WorkingTreeFormat2')
 

=== modified file 'bzrlib/repository.py'
--- a/bzrlib/repository.py	2011-03-09 01:33:12 +0000
+++ b/bzrlib/repository.py	2011-03-12 21:22:14 +0000
@@ -46,6 +46,7 @@
     versionedfile,
     )
 from bzrlib.bundle import serializer
+from bzrlib.recordcounter import RecordCounter
 from bzrlib.revisiontree import RevisionTree
 from bzrlib.store.versioned import VersionedFileStore
 from bzrlib.testament import Testament
@@ -65,7 +66,6 @@
     ROOT_ID,
     entry_factory,
     )
-from bzrlib.recordcounter import RecordCounter
 from bzrlib.lock import _RelockDebugMixin, LogicalLockResult
 from bzrlib.trace import (
     log_exception_quietly, note, mutter, mutter_callsite, warning)
@@ -3993,14 +3993,6 @@
         return wrong_parents, unused_keys
 
 
-def _old_get_graph(repository, revision_id):
-    """DO NOT USE. That is all. I'm serious."""
-    graph = repository.get_graph()
-    revision_graph = dict(((key, value) for key, value in
-        graph.iter_ancestry([revision_id]) if value is not None))
-    return _strip_NULL_ghosts(revision_graph)
-
-
 def _strip_NULL_ghosts(revision_graph):
     """Also don't use this. more compatibility code for unmigrated clients."""
     # Filter ghosts, and null:
@@ -4520,6 +4512,3 @@
     except StopIteration:
         # No more history
         return
-
-
-

=== modified file 'bzrlib/tests/per_controldir_colo/test_supported.py'
--- a/bzrlib/tests/per_controldir_colo/test_supported.py	2011-01-27 13:58:35 +0000
+++ b/bzrlib/tests/per_controldir_colo/test_supported.py	2011-03-13 00:55:23 +0000
@@ -33,7 +33,10 @@
         branch = self.make_branch('branch')
         bzrdir = branch.bzrdir
         colo_branch = bzrdir.create_branch('colo')
-        bzrdir.destroy_branch("colo")
+        try:
+            bzrdir.destroy_branch("colo")
+        except (errors.UnsupportedOperation, errors.TransportNotPossible):
+            raise tests.TestNotApplicable('Format does not support destroying branch')
         self.assertRaises(errors.NotBranchError, bzrdir.open_branch,
                           "colo")
 

=== modified file 'bzrlib/tests/test_import_tariff.py'
--- a/bzrlib/tests/test_import_tariff.py	2011-03-11 15:36:12 +0000
+++ b/bzrlib/tests/test_import_tariff.py	2011-03-12 21:22:14 +0000
@@ -117,6 +117,8 @@
             'bzrlib.plugins.weave_fmt.bzrdir',
             'bzrlib.plugins.weave_fmt.repository',
             'bzrlib.plugins.weave_fmt.workingtree',
+            'bzrlib.weave',
+            'bzrlib.weavefile',
             'bzrlib.xml4',
             'bzrlib.xml5',
             'bzrlib.xml6',




More information about the bazaar-commits mailing list