mercurial/bundle2.py
changeset 20811 9785c3f8f598
parent 20810 47293877b54c
child 20812 e2f908773754
--- a/mercurial/bundle2.py	Tue Mar 18 16:12:33 2014 -0700
+++ b/mercurial/bundle2.py	Tue Mar 18 17:38:11 2014 -0700
@@ -43,9 +43,7 @@
   parameters.
 
   The blob contains a space separated list of parameters. parameter with value
-  are stored in the form `<name>=<value>`.
-
-  Special character in param name are not supported yet.
+  are stored in the form `<name>=<value>`. Both name and value are urlquoted.
 
   Stream parameters use a simple textual format for two main reasons:
 
@@ -72,6 +70,7 @@
 
 import util
 import struct
+import urllib
 
 import changegroup
 from i18n import _
@@ -116,8 +115,9 @@
         """return a encoded version of all stream parameters"""
         blocks = []
         for par, value in self._params:
-            # XXX no escaping yet
+            par = urllib.quote(par)
             if value is not None:
+                value = urllib.quote(value)
                 par = '%s=%s' % (par, value)
             blocks.append(par)
         return ' '.join(blocks)