comparison mercurial/wireproto.py @ 24797:0c4d5e01b31f

bundle2-wireproto: properly propagate the server output on error (issue4594) In case of errors, output parts salvaged from the reply bundle are re-injected into the bundle carrying the exception. We still need to fix the situation for non-wireprotocol push.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 16 Apr 2015 03:17:37 -0400
parents 61ff209fc01d
children 631766d1f57a
comparison
equal deleted inserted replaced
24796:61ff209fc01d 24797:0c4d5e01b31f
856 return pushres(0) 856 return pushres(0)
857 except error.PushRaced: 857 except error.PushRaced:
858 return pusherr(str(exc)) 858 return pusherr(str(exc))
859 859
860 bundler = bundle2.bundle20(repo.ui) 860 bundler = bundle2.bundle20(repo.ui)
861 for out in getattr(exc, '_bundle2salvagedoutput', ()):
862 bundler.addpart(out)
861 try: 863 try:
862 raise 864 raise
863 except error.BundleValueError, exc: 865 except error.BundleValueError, exc:
864 errpart = bundler.newpart('error:unsupportedcontent') 866 errpart = bundler.newpart('error:unsupportedcontent')
865 if exc.parttype is not None: 867 if exc.parttype is not None: