changeset 20812:e2f908773754

bundle2: urlunquote stream parameter name and value during unbundling Align to new escaping used during bundling.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Tue, 18 Mar 2014 17:43:08 -0700
parents 9785c3f8f598
children 8c74b3ce5b70
files mercurial/bundle2.py tests/test-bundle2.t
diffstat 2 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/bundle2.py	Tue Mar 18 17:38:11 2014 -0700
+++ b/mercurial/bundle2.py	Tue Mar 18 17:43:08 2014 -0700
@@ -153,6 +153,7 @@
         if paramssize:
             for p in self._readexact(paramssize).split(' '):
                 p = p.split('=', 1)
+                p = [urllib.unquote(i) for i in p]
                 if len(p) < 2:
                     p.append(None)
                 params[p[0]] = p[1]
--- a/tests/test-bundle2.t	Tue Mar 18 17:38:11 2014 -0700
+++ b/tests/test-bundle2.t	Tue Mar 18 17:43:08 2014 -0700
@@ -140,3 +140,12 @@
 
   $ hg bundle2 --param 'e|! 7/=babar%#==tutu' --param simple
   HG20\x00)e%7C%21%207/=babar%25%23%3D%3Dtutu simple\x00\x00 (no-eol) (esc)
+
+Test unbundling
+
+  $ hg bundle2 --param 'e|! 7/=babar%#==tutu' --param simple | hg unbundle2
+  options count: 2
+  - e|! 7/
+      babar%#==tutu
+  - simple
+  parts count:   0