Details
Details
- Reviewers
durin42 - Group Reviewers
hg-reviewers - Commits
- rHG65b86ee69383: streamclone: use command executor for wire protocol commands
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
durin42 |
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/streamclone.py (11 lines) |
Status | Author | Revision | |
---|---|---|---|
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg |
repo = pullop.repo | repo = pullop.repo | ||||
remote = pullop.remote | remote = pullop.remote | ||||
# Save remote branchmap. We will use it later to speed up branchcache | # Save remote branchmap. We will use it later to speed up branchcache | ||||
# creation. | # creation. | ||||
rbranchmap = None | rbranchmap = None | ||||
if remote.capable('branchmap'): | if remote.capable('branchmap'): | ||||
rbranchmap = remote.branchmap() | with remote.commandexecutor() as e: | ||||
rbranchmap = e.callcommand('branchmap', {}).result() | |||||
repo.ui.status(_('streaming all changes\n')) | repo.ui.status(_('streaming all changes\n')) | ||||
fp = remote.stream_out() | with remote.commandexecutor() as e: | ||||
fp = e.callcommand('stream_out', {}).result() | |||||
# TODO strictly speaking, this code should all be inside the context | |||||
# manager because the context manager is supposed to ensure all wire state | |||||
# is flushed when exiting. But the legacy peers don't do this, so it | |||||
# doesn't matter. | |||||
l = fp.readline() | l = fp.readline() | ||||
try: | try: | ||||
resp = int(l) | resp = int(l) | ||||
except ValueError: | except ValueError: | ||||
raise error.ResponseError( | raise error.ResponseError( | ||||
_('unexpected response from remote server:'), l) | _('unexpected response from remote server:'), l) | ||||
if resp == 1: | if resp == 1: | ||||
raise error.Abort(_('operation forbidden by server')) | raise error.Abort(_('operation forbidden by server')) |