comparison mercurial/localrepo.py @ 21186:9f3652e851f8 stable

bundle2: gracefully handle PushRaced error during unbundle Same drill again. We catch the PushRaced error, check if it cames from a bundle2 processing, if so we turn it into a bundle2 with a part transporting error information to be reraised client side.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Mon, 21 Apr 2014 17:51:58 -0700
parents 28d76afa1568
children 0054a77f49df 99ba1d082287
comparison
equal deleted inserted replaced
21185:5b3717e1a3ea 21186:9f3652e851f8
132 # is finally improved. 132 # is finally improved.
133 stream = util.chunkbuffer(ret.getchunks()) 133 stream = util.chunkbuffer(ret.getchunks())
134 ret = bundle2.unbundle20(self.ui, stream) 134 ret = bundle2.unbundle20(self.ui, stream)
135 return ret 135 return ret
136 except error.PushRaced, exc: 136 except error.PushRaced, exc:
137 raise error.ResponseError(_('push failed:'), exc.message) 137 raise error.ResponseError(_('push failed:'), str(exc))
138 138
139 def lock(self): 139 def lock(self):
140 return self._repo.lock() 140 return self._repo.lock()
141 141
142 def addchangegroup(self, cg, source, url): 142 def addchangegroup(self, cg, source, url):