Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHG7d2292416046: py3: handle keyword arguments correctly in wireproto.py
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
( )
| hg-reviewers |
| Lint Skipped |
| Unit Tests Skipped |
| def _submitone(self, op, args): | def _submitone(self, op, args): | ||||
| return self._call(op, **pycompat.strkwargs(args)) | return self._call(op, **pycompat.strkwargs(args)) | ||||
| def debugwireargs(self, one, two, three=None, four=None, five=None): | def debugwireargs(self, one, two, three=None, four=None, five=None): | ||||
| # don't pass optional arguments left at their default value | # don't pass optional arguments left at their default value | ||||
| opts = {} | opts = {} | ||||
| if three is not None: | if three is not None: | ||||
| opts['three'] = three | opts[r'three'] = three | ||||
| if four is not None: | if four is not None: | ||||
| opts['four'] = four | opts[r'four'] = four | ||||
| return self._call('debugwireargs', one=one, two=two, **opts) | return self._call('debugwireargs', one=one, two=two, **opts) | ||||
| def _call(self, cmd, **args): | def _call(self, cmd, **args): | ||||
| """execute <cmd> on the server | """execute <cmd> on the server | ||||
| The command is expected to return a simple string. | The command is expected to return a simple string. | ||||
| returns the server reply as a string.""" | returns the server reply as a string.""" | ||||
| missingheads=heads) | missingheads=heads) | ||||
| cg = changegroupmod.makechangegroup(repo, outgoing, '01', 'serve') | cg = changegroupmod.makechangegroup(repo, outgoing, '01', 'serve') | ||||
| return streamres(reader=cg, v1compressible=True) | return streamres(reader=cg, v1compressible=True) | ||||
| @wireprotocommand('debugwireargs', 'one two *') | @wireprotocommand('debugwireargs', 'one two *') | ||||
| def debugwireargs(repo, proto, one, two, others): | def debugwireargs(repo, proto, one, two, others): | ||||
| # only accept optional args from the known set | # only accept optional args from the known set | ||||
| opts = options('debugwireargs', ['three', 'four'], others) | opts = options('debugwireargs', ['three', 'four'], others) | ||||
| return repo.debugwireargs(one, two, **opts) | return repo.debugwireargs(one, two, **pycompat.strkwargs(opts)) | ||||
| @wireprotocommand('getbundle', '*') | @wireprotocommand('getbundle', '*') | ||||
| def getbundle(repo, proto, others): | def getbundle(repo, proto, others): | ||||
| opts = options('getbundle', gboptsmap.keys(), others) | opts = options('getbundle', gboptsmap.keys(), others) | ||||
| for k, v in opts.iteritems(): | for k, v in opts.iteritems(): | ||||
| keytype = gboptsmap[k] | keytype = gboptsmap[k] | ||||
| if keytype == 'nodes': | if keytype == 'nodes': | ||||
| opts[k] = decodelist(v) | opts[k] = decodelist(v) | ||||