Rev 2729: get_transport accepts empty list for possible_tranports in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Mon Aug 20 07:49:32 BST 2007


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

------------------------------------------------------------
revno: 2729
revision-id: pqm at pqm.ubuntu.com-20070820064929-dee3a9wfukd1qwfb
parent: pqm at pqm.ubuntu.com-20070820061034-4y2ywj61q0on3mcj
parent: aaron.bentley at utoronto.ca-20070820052707-j2qddps1feq166j3
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Mon 2007-08-20 07:49:29 +0100
message:
  get_transport accepts empty list for possible_tranports
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/tests/test_transport.py testtransport.py-20050718175618-e5cdb99f4555ddce
  bzrlib/transport/__init__.py   transport.py-20050711165921-4978aa7ce1285ad5
    ------------------------------------------------------------
    revno: 1551.2.49.1.40.1.22.1.42.1.31.1.39.1.17.1.77.1.3.1.11
    merged: aaron.bentley at utoronto.ca-20070820052707-j2qddps1feq166j3
    parent: aaron.bentley at utoronto.ca-20070819203810-1zf6k4sb4yb4wz0u
    committer: Aaron Bentley <aaron.bentley at utoronto.ca>
    branch nick: Aaron's mergeable stuff
    timestamp: Mon 2007-08-20 01:27:07 -0400
    message:
      Update NEWS
    ------------------------------------------------------------
    revno: 1551.2.49.1.40.1.22.1.42.1.31.1.39.1.17.1.77.1.3.1.10
    merged: aaron.bentley at utoronto.ca-20070819203810-1zf6k4sb4yb4wz0u
    parent: abentley at panoramicfeedback.com-20070817175635-01tlqb2646s2spi5
    committer: Aaron Bentley <aaron.bentley at utoronto.ca>
    branch nick: Aaron's mergeable stuff
    timestamp: Sun 2007-08-19 16:38:10 -0400
    message:
      get_transport appends to possible_transports if it's an empty list
=== modified file 'NEWS'
--- a/NEWS	2007-08-17 17:56:35 +0000
+++ b/NEWS	2007-08-20 05:27:07 +0000
@@ -21,6 +21,10 @@
       versionedfile.  (Aaron Bentley)
 
     * Diffs generated using "diff -p" no longer break the patch parser.
+      (Aaron Bentley)
+
+    * get_transport treats an empty possible_transports list the same as a non-
+      empty one.  (Aaron Bentley)
 
   IMPROVEMENTS:
 

=== modified file 'bzrlib/tests/test_transport.py'
--- a/bzrlib/tests/test_transport.py	2007-08-15 04:56:08 +0000
+++ b/bzrlib/tests/test_transport.py	2007-08-19 20:38:10 +0000
@@ -690,7 +690,10 @@
     """Tests for transport reuse"""
 
     def test_reuse_same_transport(self):
-        t1 = get_transport('http://foo/')
+        possible_transports = []
+        t1 = get_transport('http://foo/',
+                           possible_transports=possible_transports)
+        self.assertEqual([t1], possible_transports)
         t2 = get_transport('http://foo/', possible_transports=[t1])
         self.assertIs(t1, t2)
 

=== modified file 'bzrlib/transport/__init__.py'
--- a/bzrlib/transport/__init__.py	2007-08-16 01:02:17 +0000
+++ b/bzrlib/transport/__init__.py	2007-08-19 20:38:10 +0000
@@ -1392,7 +1392,7 @@
             'URLs must be properly escaped (protocol: %s)')
 
     transport = None
-    if possible_transports:
+    if possible_transports is not None:
         for t in possible_transports:
             t_same_connection = t._reuse_for(base)
             if t_same_connection is not None:
@@ -1405,7 +1405,7 @@
         if proto is not None and base.startswith(proto):
             transport, last_err = _try_transport_factories(base, factory_list)
             if transport:
-                if possible_transports:
+                if possible_transports is not None:
                     assert transport not in possible_transports
                     possible_transports.append(transport)
                 return transport




More information about the bazaar-commits mailing list