# HG changeset patch # User Matt Mackall # Date 2015-01-18 02:08:47 # Node ID a3f7c781786bc2f150854ea9030a95d47448a9ac # Parent 5b20e4c321177495148839a79d1f0908e6456492 bundle2: fix parttype enforcement As spotted by Malte Helmert. diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py --- a/mercurial/bundle2.py +++ b/mercurial/bundle2.py @@ -85,7 +85,7 @@ Binary format is as follow :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 @@ preferedchunksize = 4096 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):