changeset 23916:a3f7c781786b

bundle2: fix parttype enforcement As spotted by Malte Helmert.
author Matt Mackall <mpm@selenic.com>
date Sat, 17 Jan 2015 18:08:47 -0800
parents 5b20e4c32117
children 3cbb5bf4035d
files mercurial/bundle2.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/bundle2.py	Sat Jan 17 17:59:30 2015 -0800
+++ b/mercurial/bundle2.py	Sat Jan 17 18:08:47 2015 -0800
@@ -85,7 +85,7 @@
 
     :typesize: (one byte)
 
-    :parttype: alphanumerical part name (restricted to ^a-zA-Z0-9_:-])
+    :parttype: alphanumerical part name (restricted to [a-zA-Z0-9_:-]*)
 
     :partid: A 32bits integer (unique in the bundle) that can be used to refer
              to this part.
@@ -176,7 +176,7 @@
 
 def validateparttype(parttype):
     """raise ValueError if a parttype contains invalid character"""
-    if _parttypeforbidden.match(parttype):
+    if _parttypeforbidden.search(parttype):
         raise ValueError(parttype)
 
 def _makefpartparamsizes(nbparams):