diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py --- a/mercurial/bundle2.py +++ b/mercurial/bundle2.py @@ -831,8 +831,13 @@ def handlereplycaps(op, inpart): @parthandler('b2x:error:unsupportedcontent') def handlereplycaps(op, inpart): """Used to transmit unknown content error over the wire""" - parttype = inpart.params['parttype'] - raise error.BundleValueError(parttype=parttype) + kwargs = {} + kwargs['parttype'] = inpart.params['parttype'] + params = inpart.params.get('params') + if params is not None: + kwargs['params'] = params.split('\0') + + raise error.BundleValueError(**kwargs) @parthandler('b2x:error:pushraced') def handlereplycaps(op, inpart): diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py --- a/mercurial/wireproto.py +++ b/mercurial/wireproto.py @@ -807,6 +807,8 @@ def unbundle(repo, proto, heads): bundler = bundle2.bundle20(repo.ui) errpart = bundler.newpart('B2X:ERROR:UNSUPPORTEDCONTENT') errpart.addparam('parttype', exc.parttype) + if exc.params: + errpart.addparam('params', '\0'.join(exc.params)) return streamres(bundler.getchunks()) except util.Abort, inst: # The old code we moved used sys.stderr directly.