# HG changeset patch # User liscju # Date 1447624708 -3600 # Node ID 216cc65cf2276cccb052dbd11a6cb46408b5f87d # Parent 7a8e9a985c3bcd2d3bb0298b0fd71f2f6f7aa836 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. diff -r 7a8e9a985c3b -r 216cc65cf227 mercurial/commands.py --- a/mercurial/commands.py Wed Nov 11 10:19:11 2015 -0800 +++ b/mercurial/commands.py Sun Nov 15 22:58:28 2015 +0100 @@ -5227,10 +5227,9 @@ checkout, movemarkfrom, brev = updata ret = hg.update(repo, checkout) except error.UpdateAbort as inst: - ui.warn(_("not updating: %s\n") % str(inst)) - if inst.hint: - ui.warn(_("(%s)\n") % inst.hint) - return 0 + msg = _("not updating: %s") % str(inst) + hint = inst.hint + raise error.UpdateAbort(msg, hint=hint) if not ret and not checkout: if bookmarks.update(repo, [movemarkfrom], repo['.'].node()): ui.status(_("updating bookmark %s\n") % repo._activebookmark) diff -r 7a8e9a985c3b -r 216cc65cf227 tests/test-issue1502.t --- a/tests/test-issue1502.t Wed Nov 11 10:19:11 2015 -0800 +++ b/tests/test-issue1502.t Sun Nov 15 22:58:28 2015 +0100 @@ -19,8 +19,9 @@ adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) - not updating: not a linear update + abort: not updating: not a linear update (merge or update --check to force update) + [255] $ hg -R foo1 book branchy $ hg -R foo1 book diff -r 7a8e9a985c3b -r 216cc65cf227 tests/test-pull-update.t --- a/tests/test-pull-update.t Wed Nov 11 10:19:11 2015 -0800 +++ b/tests/test-pull-update.t Sun Nov 15 22:58:28 2015 +0100 @@ -25,8 +25,9 @@ adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) - not updating: not a linear update + abort: not updating: not a linear update (merge or update --check to force update) + [255] $ cd ../tt @@ -39,8 +40,9 @@ adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) - not updating: not a linear update + abort: not updating: not a linear update (merge or update --check to force update) + [255] $ HGMERGE=true hg merge merging foo