# HG changeset patch # User Pierre-Yves David # Date 2014-05-27 17:32:07 # Node ID 292331e906d7b91aaf9c8b5a9207790fe05cdcc1 # Parent 7568f5c1c80175dcb2ffd50f79c28cde5f1951bc bundle2: rename b2x:error:unknownpart to b2x:error:unsupportedcontent This is a backward compatibility breakage per se. But bundle2 was explicitly flagged as experimental, and this is one an error path anyway. So the worse possible outcome from this change is to still have a crash but with a different message. diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py --- a/mercurial/bundle2.py +++ b/mercurial/bundle2.py @@ -828,9 +828,9 @@ def handlereplycaps(op, inpart): """Used to transmit abort error over the wire""" raise util.Abort(inpart.params['message'], hint=inpart.params.get('hint')) -@parthandler('b2x:error:unknownpart') +@parthandler('b2x:error:unsupportedcontent') def handlereplycaps(op, inpart): - """Used to transmit unknown part error over the wire""" + """Used to transmit unknown content error over the wire""" raise error.BundleValueError(inpart.params['parttype']) @parthandler('b2x:error:pushraced') diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py --- a/mercurial/wireproto.py +++ b/mercurial/wireproto.py @@ -805,7 +805,8 @@ def unbundle(repo, proto, heads): os.unlink(tempname) except error.BundleValueError, exc: bundler = bundle2.bundle20(repo.ui) - bundler.newpart('B2X:ERROR:UNKNOWNPART', [('parttype', str(exc))]) + errpart = bundler.newpart('B2X:ERROR:UNSUPPORTEDCONTENT') + errpart.addparam('parttype', str(exc)) return streamres(bundler.getchunks()) except util.Abort, inst: # The old code we moved used sys.stderr directly.