comparison mercurial/localrepo.py @ 21184:28d76afa1568 stable

bundle2: fix raising errors during heads checking If the heads on the server differ from the ones reported seen by the client at bundle time, we raise a PushRaced exception. However, the part raising the exception was broken. To fix it, we move the PushRaced class in the error module so it can be accessible everywhere without an import cycle. A test is also added to prevent regression.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Mon, 21 Apr 2014 18:59:09 -0700
parents 60ad2ea5b106
children 9f3652e851f8
comparison
equal deleted inserted replaced
21183:4345274adc4b 21184:28d76afa1568
131 # This little dance should be dropped eventually when the API 131 # This little dance should be dropped eventually when the API
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 exchange.PushRaced, exc: 136 except error.PushRaced, exc:
137 raise error.ResponseError(_('push failed:'), exc.message) 137 raise error.ResponseError(_('push failed:'), exc.message)
138 138
139 def lock(self): 139 def lock(self):
140 return self._repo.lock() 140 return self._repo.lock()
141 141