Mercurial > public > mercurial-scm > hg
comparison mercurial/destutil.py @ 26683:634666c48b7d
update: introduce a 'UpdateAbort' exception
The 'postincoming' function used by 'hg pull --update' and 'hg unbundle' is
catching 'Abort' exceptions to intercept failed update. This feel a bit too
wide to me, so I'm introducing a more precise exception to specify update
destination issues.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Mon, 05 Oct 2015 04:26:26 -0700 |
parents | 5c57d01fe64e |
children | 9903261dcc81 |
comparison
equal
deleted
inserted
replaced
26682:08b068240a1a | 26683:634666c48b7d |
---|---|
82 if not repo[rev].node() in foreground: | 82 if not repo[rev].node() in foreground: |
83 if dirty: | 83 if dirty: |
84 msg = _("uncommitted changes") | 84 msg = _("uncommitted changes") |
85 hint = _("commit and merge, or update --clean to" | 85 hint = _("commit and merge, or update --clean to" |
86 " discard changes") | 86 " discard changes") |
87 raise error.Abort(msg, hint=hint) | 87 raise error.UpdateAbort(msg, hint=hint) |
88 elif not check: # destination is not a descendant. | 88 elif not check: # destination is not a descendant. |
89 msg = _("not a linear update") | 89 msg = _("not a linear update") |
90 hint = _("merge or update --check to force update") | 90 hint = _("merge or update --check to force update") |
91 raise error.Abort(msg, hint=hint) | 91 raise error.UpdateAbort(msg, hint=hint) |
92 | 92 |
93 return rev, movemark, activemark | 93 return rev, movemark, activemark |