Rev 4790: Fix a code path that was trying to open a URL as though it was a local path. in

John Arbash Meinel john at
Sun Nov 8 03:25:39 GMT 2009


revno: 4790
revision-id: john at
parent: pqm at
committer: John Arbash Meinel <john at>
branch nick: 2.1.0b4-win32-sprout-bzrdir
timestamp: Sat 2009-11-07 21:25:29 -0600
  Fix a code path that was trying to open a URL as though it was a local path.
  It turned out that this never failed on Linux because we were trapping for ENOENT.
  However, on Windows we get a different error because 'file://' is an invalid
  filename. Fixing that ended up finding some other small issues because of
  things like expecting 'TREE_ROOT' to be in the inventory xml, but it wasn't.
  I'm not 100% sure about that fix, but since this code *wasn't* tested at all, it
  doesn't seem terribly important.
-------------- next part --------------
=== modified file 'bzrlib/tests/per_bzrdir/'
--- a/bzrlib/tests/per_bzrdir/	2009-09-18 17:19:15 +0000
+++ b/bzrlib/tests/per_bzrdir/	2009-11-08 03:25:29 +0000
@@ -778,13 +778,18 @@
+            local_inventory = dir.transport.local_abspath('inventory')
+        except errors.NotLocalUrl:
+            return
+        try:
             # If we happen to have a tree, we'll guarantee everything
             # except for the tree root is the same.
-            inventory_f = file(dir.transport.base+'inventory', 'rb')
-            self.assertContainsRe(,
-                                  '<inventory file_id="TREE_ROOT[^"]*"'
-                                  ' format="5">\n</inventory>\n')
-            inventory_f.close()
+            inventory_f = file(local_inventory, 'rb')
+            try:
+                self.assertContainsRe(,
+                                      '<inventory format="5">\n</inventory>\n')
+            finally:
+                inventory_f.close()
         except IOError, e:
             if e.errno != errno.ENOENT:

More information about the bazaar-commits mailing list