Rev 4115: (Jonathan Lange) Don't escape tildes in URLs. in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Wed Mar 11 11:01:07 GMT 2009


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

------------------------------------------------------------
revno: 4115
revision-id: pqm at pqm.ubuntu.com-20090311110102-y233cktxicmatxjc
parent: pqm at pqm.ubuntu.com-20090311102200-heffmfrrstw2fovy
parent: jml at canonical.com-20090311002554-znxxddpkk4o1kqwx
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Wed 2009-03-11 11:01:02 +0000
message:
  (Jonathan Lange) Don't escape tildes in URLs.
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/tests/test_urlutils.py  test_urlutils.py-20060502192900-46b1f9579987cf9c
  bzrlib/urlutils.py             urlutils.py-20060502195429-e8a161ecf8fac004
    ------------------------------------------------------------
    revno: 4098.3.2
    revision-id: jml at canonical.com-20090311002554-znxxddpkk4o1kqwx
    parent: jml at canonical.com-20090311002346-qcistwhfguu6lmvs
    committer: Jonathan Lange <jml at canonical.com>
    branch nick: tildes-are-love
    timestamp: Wed 2009-03-11 10:25:54 +1000
    message:
      NEWS update.
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
    ------------------------------------------------------------
    revno: 4098.3.1
    revision-id: jml at canonical.com-20090311002346-qcistwhfguu6lmvs
    parent: pqm at pqm.ubuntu.com-20090309084556-9i2m12qlud2qcrtw
    committer: Jonathan Lange <jml at canonical.com>
    branch nick: tildes-are-love
    timestamp: Wed 2009-03-11 10:23:46 +1000
    message:
      Don't escape tildes
    modified:
      bzrlib/tests/test_urlutils.py  test_urlutils.py-20060502192900-46b1f9579987cf9c
      bzrlib/urlutils.py             urlutils.py-20060502195429-e8a161ecf8fac004
=== modified file 'NEWS'
--- a/NEWS	2009-03-11 08:25:42 +0000
+++ b/NEWS	2009-03-11 11:01:02 +0000
@@ -92,6 +92,9 @@
 
     * ``bzr send`` now supports MH-E via ``emacsclient``. (Eric Gillespie)
 
+    * Tildes are no longer escaped. No more %7Euser/project/branch!
+      (Jonathan Lange)
+
   BUG FIXES:
 
     * Bazaar now gives a better message including the filename if it's

=== modified file 'bzrlib/tests/test_urlutils.py'
--- a/bzrlib/tests/test_urlutils.py	2009-01-17 01:30:58 +0000
+++ b/bzrlib/tests/test_urlutils.py	2009-03-11 00:23:46 +0000
@@ -497,6 +497,9 @@
         self.assertEqual('%C3%A5', urlutils.escape(u'\xe5'))
         self.assertFalse(isinstance(urlutils.escape(u'\xe5'), unicode))
 
+    def test_escape_tildes(self):
+        self.assertEqual('~foo', urlutils.escape('~foo'))
+
     def test_unescape(self):
         self.assertEqual('%', urlutils.unescape('%25'))
         self.assertEqual(u'\xe5', urlutils.unescape('%C3%A5'))

=== modified file 'bzrlib/urlutils.py'
--- a/bzrlib/urlutils.py	2009-01-17 01:30:58 +0000
+++ b/bzrlib/urlutils.py	2009-03-11 00:23:46 +0000
@@ -68,7 +68,7 @@
         relpath = relpath.encode('utf-8')
     # After quoting and encoding, the path should be perfectly
     # safe as a plain ASCII string, str() just enforces this
-    return str(urllib.quote(relpath))
+    return str(urllib.quote(relpath, safe='/~'))
 
 
 def file_relpath(base, path):




More information about the bazaar-commits mailing list