Mercurial > hg
comparison mercurial/exchange.py @ 37646:72e26319f3b8
wireproto: use command executor for unbundle
This also required unifying the name of the argument because the
new API always passes arguments by keyword. I decided to change
implementations to "bundle" instead of the interface to "cg"
because "bundle" is more appropriate in a modern world.
Differential Revision: https://phab.mercurial-scm.org/D3314
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Fri, 13 Apr 2018 11:30:44 -0700 |
parents | cc8c06835097 |
children | 516b5a5edae3 |
comparison
equal
deleted
inserted
replaced
37645:72b0982cd509 | 37646:72e26319f3b8 |
---|---|
1094 if bundler.nbparts <= 1: | 1094 if bundler.nbparts <= 1: |
1095 return | 1095 return |
1096 stream = util.chunkbuffer(bundler.getchunks()) | 1096 stream = util.chunkbuffer(bundler.getchunks()) |
1097 try: | 1097 try: |
1098 try: | 1098 try: |
1099 reply = pushop.remote.unbundle( | 1099 with pushop.remote.commandexecutor() as e: |
1100 stream, ['force'], pushop.remote.url()) | 1100 reply = e.callcommand('unbundle', { |
1101 'bundle': stream, | |
1102 'heads': ['force'], | |
1103 'url': pushop.remote.url(), | |
1104 }).result() | |
1101 except error.BundleValueError as exc: | 1105 except error.BundleValueError as exc: |
1102 raise error.Abort(_('missing support for %s') % exc) | 1106 raise error.Abort(_('missing support for %s') % exc) |
1103 try: | 1107 try: |
1104 trgetter = None | 1108 trgetter = None |
1105 if pushback: | 1109 if pushback: |