Rev 2239: handle forward slashes in the path part of a url. in http://people.samba.org/bzr/jelmer/bzr-svn/0.5

Jelmer Vernooij jelmer at samba.org
Mon Dec 8 16:01:53 GMT 2008


At http://people.samba.org/bzr/jelmer/bzr-svn/0.5

------------------------------------------------------------
revno: 2239
revision-id: jelmer at samba.org-20081208160150-dlces7i0kammh3xb
parent: jelmer at samba.org-20081208150156-1ge9qx3536dn6wrf
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.5
timestamp: Mon 2008-12-08 17:01:50 +0100
message:
  handle forward slashes in the path part of a url.
modified:
  NEWS                           news-20061231030336-h9fhq245ie0de8bs-1
  tests/test_radir.py            test_radir.py-20061231173434-31utf9o4byu7wktm-1
  transport.py                   transport.py-20060406231150-b3472d06b3a0818d
=== modified file 'NEWS'
--- a/NEWS	2008-12-08 15:01:56 +0000
+++ b/NEWS	2008-12-08 16:01:50 +0000
@@ -7,6 +7,8 @@
 
    * Fix some tests when running overall bzr testsuite. (#306158)
 
+   * Handle duplicate forward slashes in the path part of a URL. 
+
 bzr-svn 0.5.0~rc1			2008-12-08
 
   CHANGES

=== modified file 'tests/test_radir.py'
--- a/tests/test_radir.py	2008-10-02 21:18:28 +0000
+++ b/tests/test_radir.py	2008-12-08 16:01:50 +0000
@@ -44,6 +44,13 @@
         x = BzrDir.open(repos_url)
         x.break_lock()
 
+    def test_too_much_slashes(self):
+        repos_url = self.make_repository("d")
+
+        repos_url = repos_url[:-1] + "///d"
+
+        BzrDir.open(repos_url)
+
     def test_open_workingtree(self):
         repos_url = self.make_repository("d")
         x = BzrDir.open(repos_url)

=== modified file 'transport.py'
--- a/transport.py	2008-12-04 15:07:45 +0000
+++ b/transport.py	2008-12-08 16:01:50 +0000
@@ -72,6 +72,8 @@
     if scheme in ("http", "https"):
         # Without this, URLs with + in them break
         path = urllib.unquote(path)
+    while "//" in path:
+        path = path.replace("//", "/")
     return urlparse.urlunsplit((scheme, netloc, path, query, fragment))
 
 




More information about the bazaar-commits mailing list