##// END OF EJS Templates
update: introduce a 'UpdateAbort' exception...
Pierre-Yves David -
r26683:634666c4 default
parent child Browse files
Show More
@@ -5196,7 +5196,7 b' def postincoming(ui, repo, modheads, opt'
5196 updata = destutil.destupdate(repo)
5196 updata = destutil.destupdate(repo)
5197 checkout, movemarkfrom, brev = updata
5197 checkout, movemarkfrom, brev = updata
5198 ret = hg.update(repo, checkout)
5198 ret = hg.update(repo, checkout)
5199 except error.Abort as inst:
5199 except error.UpdateAbort as inst:
5200 ui.warn(_("not updating: %s\n") % str(inst))
5200 ui.warn(_("not updating: %s\n") % str(inst))
5201 if inst.hint:
5201 if inst.hint:
5202 ui.warn(_("(%s)\n") % inst.hint)
5202 ui.warn(_("(%s)\n") % inst.hint)
@@ -84,10 +84,10 b' def destupdate(repo, clean=False, check='
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
@@ -66,6 +66,9 b' class HookAbort(Abort):'
66 class ConfigError(Abort):
66 class ConfigError(Abort):
67 """Exception raised when parsing config files"""
67 """Exception raised when parsing config files"""
68
68
69 class UpdateAbort(Abort):
70 """Raised when an update is aborted for destination issue"""
71
69 class OutOfBandError(Exception):
72 class OutOfBandError(Exception):
70 """Exception raised when a remote repo reports failure"""
73 """Exception raised when a remote repo reports failure"""
71
74
General Comments 0
You need to be logged in to leave comments. Login now