Mercurial > hg
comparison mercurial/exchange.py @ 46977:3f87d2af0bd6
errors: raise RemoteError in some places in exchange.py
This is part of https://www.mercurial-scm.org/wiki/ErrorCategoriesPlan
Differential Revision: https://phab.mercurial-scm.org/D10467
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Mon, 19 Apr 2021 12:52:23 -0700 |
parents | ffd3e823a7e5 |
children | d55b71393907 |
comparison
equal
deleted
inserted
replaced
46976:f9482db16cef | 46977:3f87d2af0bd6 |
---|---|
1145 b'heads': [b'force'], | 1145 b'heads': [b'force'], |
1146 b'url': pushop.remote.url(), | 1146 b'url': pushop.remote.url(), |
1147 }, | 1147 }, |
1148 ).result() | 1148 ).result() |
1149 except error.BundleValueError as exc: | 1149 except error.BundleValueError as exc: |
1150 raise error.Abort(_(b'missing support for %s') % exc) | 1150 raise error.RemoteError(_(b'missing support for %s') % exc) |
1151 try: | 1151 try: |
1152 trgetter = None | 1152 trgetter = None |
1153 if pushback: | 1153 if pushback: |
1154 trgetter = pushop.trmanager.transaction | 1154 trgetter = pushop.trmanager.transaction |
1155 op = bundle2.processbundle(pushop.repo, reply, trgetter) | 1155 op = bundle2.processbundle(pushop.repo, reply, trgetter) |
1156 except error.BundleValueError as exc: | 1156 except error.BundleValueError as exc: |
1157 raise error.Abort(_(b'missing support for %s') % exc) | 1157 raise error.RemoteError(_(b'missing support for %s') % exc) |
1158 except bundle2.AbortFromPart as exc: | 1158 except bundle2.AbortFromPart as exc: |
1159 pushop.ui.error(_(b'remote: %s\n') % exc) | 1159 pushop.ui.error(_(b'remote: %s\n') % exc) |
1160 if exc.hint is not None: | 1160 if exc.hint is not None: |
1161 pushop.ui.error(_(b'remote: %s\n') % (b'(%s)' % exc.hint)) | 1161 pushop.ui.error(_(b'remote: %s\n') % (b'(%s)' % exc.hint)) |
1162 raise error.Abort(_(b'push failed on remote')) | 1162 raise error.RemoteError(_(b'push failed on remote')) |
1163 except error.PushkeyFailed as exc: | 1163 except error.PushkeyFailed as exc: |
1164 partid = int(exc.partid) | 1164 partid = int(exc.partid) |
1165 if partid not in pushop.pkfailcb: | 1165 if partid not in pushop.pkfailcb: |
1166 raise | 1166 raise |
1167 pushop.pkfailcb[partid](pushop, exc) | 1167 pushop.pkfailcb[partid](pushop, exc) |
1873 ) | 1873 ) |
1874 op.modes[b'bookmarks'] = b'records' | 1874 op.modes[b'bookmarks'] = b'records' |
1875 bundle2.processbundle(pullop.repo, bundle, op=op) | 1875 bundle2.processbundle(pullop.repo, bundle, op=op) |
1876 except bundle2.AbortFromPart as exc: | 1876 except bundle2.AbortFromPart as exc: |
1877 pullop.repo.ui.error(_(b'remote: abort: %s\n') % exc) | 1877 pullop.repo.ui.error(_(b'remote: abort: %s\n') % exc) |
1878 raise error.Abort(_(b'pull failed on remote'), hint=exc.hint) | 1878 raise error.RemoteError(_(b'pull failed on remote'), hint=exc.hint) |
1879 except error.BundleValueError as exc: | 1879 except error.BundleValueError as exc: |
1880 raise error.Abort(_(b'missing support for %s') % exc) | 1880 raise error.RemoteError(_(b'missing support for %s') % exc) |
1881 | 1881 |
1882 if pullop.fetch: | 1882 if pullop.fetch: |
1883 pullop.cgresult = bundle2.combinechangegroupresults(op) | 1883 pullop.cgresult = bundle2.combinechangegroupresults(op) |
1884 | 1884 |
1885 # processing phases change | 1885 # processing phases change |