Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.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 | 71a485130beb |
children | 76f20fc8d54d |
comparison
equal
deleted
inserted
replaced
26682:08b068240a1a | 26683:634666c48b7d |
---|---|
5194 movemarkfrom = None | 5194 movemarkfrom = None |
5195 if not checkout: | 5195 if not checkout: |
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) |
5203 return 0 | 5203 return 0 |
5204 if not ret and not checkout: | 5204 if not ret and not checkout: |