Mercurial > public > mercurial-scm > hg
comparison mercurial/wireprotov2server.py @ 37781:352932a11905
wireproto: move command registration types to wireprototypes
These are shared across wire protocol implementations. wireprototypes
is our module for common code.
Differential Revision: https://phab.mercurial-scm.org/D3396
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Mon, 16 Apr 2018 21:52:33 -0700 |
parents | 8acd3a9ac4fd |
children | 99accae4cc59 |
comparison
equal
deleted
inserted
replaced
37780:8acd3a9ac4fd | 37781:352932a11905 |
---|---|
436 def register(func): | 436 def register(func): |
437 if name in wireproto.commandsv2: | 437 if name in wireproto.commandsv2: |
438 raise error.ProgrammingError('%s command already registered ' | 438 raise error.ProgrammingError('%s command already registered ' |
439 'for version 2' % name) | 439 'for version 2' % name) |
440 | 440 |
441 wireproto.commandsv2[name] = wireproto.commandentry( | 441 wireproto.commandsv2[name] = wireprototypes.commandentry( |
442 func, args=args, transports=transports, permission=permission) | 442 func, args=args, transports=transports, permission=permission) |
443 | 443 |
444 return func | 444 return func |
445 | 445 |
446 return register | 446 return register |