Rev 5508: (vila) Add a temporary indirection on get_transport to fix the remaining in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Mon Oct 18 18:06:39 BST 2010


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

------------------------------------------------------------
revno: 5508 [merge]
revision-id: pqm at pqm.ubuntu.com-20101018170637-r2ta5hd72o4ficv4
parent: pqm at pqm.ubuntu.com-20101018131232-x9qjypudollqaeft
parent: gzlist at googlemail.com-20101018134107-q23jhm0h5t3qpwdl
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Mon 2010-10-18 18:06:37 +0100
message:
  (vila) Add a temporary indirection on get_transport to fix the remaining
   test leaks. (Martin [gz])
modified:
  bzrlib/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
  bzrlib/transport/__init__.py   transport.py-20050711165921-4978aa7ce1285ad5
=== modified file 'bzrlib/tests/__init__.py'
--- a/bzrlib/tests/__init__.py	2010-10-15 11:20:45 +0000
+++ b/bzrlib/tests/__init__.py	2010-10-18 17:06:37 +0000
@@ -2451,7 +2451,7 @@
                 self.addCleanup(t.disconnect)
             return t
 
-        orig_get_transport = self.overrideAttr(_mod_transport, 'get_transport',
+        orig_get_transport = self.overrideAttr(_mod_transport, '_get_transport',
                                                get_transport_with_cleanup)
         self._make_test_root()
         self.addCleanup(os.chdir, os.getcwdu())

=== modified file 'bzrlib/transport/__init__.py'
--- a/bzrlib/transport/__init__.py	2010-06-18 15:38:20 +0000
+++ b/bzrlib/transport/__init__.py	2010-10-18 13:41:07 +0000
@@ -1564,7 +1564,7 @@
         raise NotImplementedError(self.disconnect)
 
 
-def get_transport(base, possible_transports=None):
+def _get_transport(base, possible_transports=None):
     """Open a transport to access a URL or directory.
 
     :param base: either a URL or a directory name.
@@ -1630,6 +1630,15 @@
 
     return transport
 
+# GZ 2010-10-18: Temporary hack to put the real get_transport behind a layer
+#                if indirection so it can be safely overriden for the test
+#                suite. If you are reading this comment in the final 2.3
+#                release, phone me up and yell at me.
+def get_transport(base, possible_transports=None):
+    return _get_transport(base, possible_transports)
+
+get_transport.__doc__ = _get_transport.__doc__
+
 
 def _try_transport_factories(base, factory_list):
     last_err = None




More information about the bazaar-commits mailing list