diff 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
line wrap: on
line diff
--- a/mercurial/destutil.py	Mon Oct 05 21:42:09 2015 -0700
+++ b/mercurial/destutil.py	Mon Oct 05 04:26:26 2015 -0700
@@ -84,10 +84,10 @@
                     msg = _("uncommitted changes")
                     hint = _("commit and merge, or update --clean to"
                              " discard changes")
-                    raise error.Abort(msg, hint=hint)
+                    raise error.UpdateAbort(msg, hint=hint)
                 elif not check:  # destination is not a descendant.
                     msg = _("not a linear update")
                     hint = _("merge or update --check to force update")
-                    raise error.Abort(msg, hint=hint)
+                    raise error.UpdateAbort(msg, hint=hint)
 
     return rev, movemark, activemark