BUGS
- * Avoid sometimes incorrect determination of Bazaar revision numbers. (#181773)
+ * Avoid sometimes incorrect determination of Bazaar revision numbers. (#181773)
- * Deal with bzr:svn-revision-info property being removed. (#206728)
+ * Deal with bzr:svn-revision-info property being removed. (#206728)
- * Gracefully handle erroneous svk merge tickets created by old versions of svk.
+ * Gracefully handle erroneous svk merge tickets created by old versions of svk.
- * Use standard infrastructure for caching revision numbers. (#213953)
+ * Use standard infrastructure for caching revision numbers. (#213953)
+
+ * Work around bug in the Subversion libraries which don't accept
+ http(s) URLs with urlencoded characters. (#190229)
bzr-svn 0.4.9 2008-03-23
from tests import TestCaseWithSubversionRepository
from bzrlib.errors import NotBranchError, NoSuchFile, FileExists, InvalidURL
from bzrlib import urlutils
-from transport import SvnRaTransport, bzr_to_svn_url
+from transport import SvnRaTransport, bzr_to_svn_url, _url_unescape_uri
from unittest import TestCase
import os
bzr_to_svn_url("http://host/location"))
self.assertEqual("http://host/location",
bzr_to_svn_url("svn+http://host/location"))
+ self.assertEqual("http://host/gtk+/location",
+ bzr_to_svn_url("svn+http://host/gtk%2B/location"))
+
+ def test_url_unescape_uri(self):
+ self.assertEquals("http://svn.gnome.org/svn/gtk+/trunk",
+ _url_unescape_uri("http://svn.gnome.org/svn/gtk%2B/trunk"))
import svn.client
from errors import convert_svn_error, NoSvnRepositoryPresent
+import urlparse
+import urllib
svn_config = svn.core.svn_config_get_config(None)
return SvnRaTransport(bzr_transport.base)
+def _url_unescape_uri(url):
+ (scheme, netloc, path, query, fragment) = urlparse.urlsplit(url)
+ path = urllib.unquote(path)
+ return urlparse.urlunsplit((scheme, netloc, path, query, fragment))
+
+
def bzr_to_svn_url(url):
"""Convert a Bazaar URL to a URL understood by Subversion.
url.startswith("svn+https://")):
url = url[len("svn+"):] # Skip svn+
+ if url.startswith("http"):
+ # Without this, URLs with + in them break
+ url = _url_unescape_uri(url)
+
# The SVN libraries don't like trailing slashes...
- return url.rstrip('/')
+ url = url.rstrip('/')
+
+ return url
def needs_busy(unbound):