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 (14 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: | ||||
frbranchmap = e.callcommand('branchmap', {}) | |||||
rbranchmap = frbranchmap.result() | |||||
repo.ui.status(_('streaming all changes\n')) | repo.ui.status(_('streaming all changes\n')) | ||||
fp = remote.stream_out() | with remote.commandexecutor() as e: | ||||
f = e.callcommand('stream_out', {}) | |||||
# TODO strictly speaking, this should 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. | |||||
fp = f.result() | |||||
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')) |