Mercurial > hg-stable
comparison mercurial/peer.py @ 34733:115efdd97088
peer: ensure command names are always ascii bytestrs
Differential Revision: https://phab.mercurial-scm.org/D1104
author | Augie Fackler <augie@google.com> |
---|---|
date | Sun, 15 Oct 2017 00:05:00 -0400 |
parents | a652b7763f66 |
children |
comparison
equal
deleted
inserted
replaced
34732:67e9678efd98 | 34733:115efdd97088 |
---|---|
8 | 8 |
9 from __future__ import absolute_import | 9 from __future__ import absolute_import |
10 | 10 |
11 from . import ( | 11 from . import ( |
12 error, | 12 error, |
13 pycompat, | |
13 util, | 14 util, |
14 ) | 15 ) |
15 | 16 |
16 # abstract batching support | 17 # abstract batching support |
17 | 18 |
90 batchable = f(*args, **opts) | 91 batchable = f(*args, **opts) |
91 encargsorres, encresref = next(batchable) | 92 encargsorres, encresref = next(batchable) |
92 if not encresref: | 93 if not encresref: |
93 return encargsorres # a local result in this case | 94 return encargsorres # a local result in this case |
94 self = args[0] | 95 self = args[0] |
95 encresref.set(self._submitone(f.__name__, encargsorres)) | 96 cmd = pycompat.bytesurl(f.__name__) # ensure cmd is ascii bytestr |
97 encresref.set(self._submitone(cmd, encargsorres)) | |
96 return next(batchable) | 98 return next(batchable) |
97 setattr(plain, 'batchable', f) | 99 setattr(plain, 'batchable', f) |
98 return plain | 100 return plain |