comparison mercurial/commands.py @ 26968:216cc65cf227

pull: return 255 value on update failure (issue4948) (BC) Before this patch hg pull -u on UpdateAbort error returned 0 value to the system. This patch fixes this by reraising UpdateAbort with updated error msg.
author liscju <piotr.listkiewicz@gmail.com>
date Sun, 15 Nov 2015 22:58:28 +0100
parents 50d2389a2e49
children c48fee950ce4
comparison
equal deleted inserted replaced
26967:7a8e9a985c3b 26968:216cc65cf227
5225 if not checkout: 5225 if not checkout:
5226 updata = destutil.destupdate(repo) 5226 updata = destutil.destupdate(repo)
5227 checkout, movemarkfrom, brev = updata 5227 checkout, movemarkfrom, brev = updata
5228 ret = hg.update(repo, checkout) 5228 ret = hg.update(repo, checkout)
5229 except error.UpdateAbort as inst: 5229 except error.UpdateAbort as inst:
5230 ui.warn(_("not updating: %s\n") % str(inst)) 5230 msg = _("not updating: %s") % str(inst)
5231 if inst.hint: 5231 hint = inst.hint
5232 ui.warn(_("(%s)\n") % inst.hint) 5232 raise error.UpdateAbort(msg, hint=hint)
5233 return 0
5234 if not ret and not checkout: 5233 if not ret and not checkout:
5235 if bookmarks.update(repo, [movemarkfrom], repo['.'].node()): 5234 if bookmarks.update(repo, [movemarkfrom], repo['.'].node()):
5236 ui.status(_("updating bookmark %s\n") % repo._activebookmark) 5235 ui.status(_("updating bookmark %s\n") % repo._activebookmark)
5237 return ret 5236 return ret
5238 if modheads > 1: 5237 if modheads > 1: