##// END OF EJS Templates
wireproto: add decorator for wire protocol command...
Pierre-Yves David -
r20906:7a634b34 default
parent child Browse files
Show More
@@ -471,6 +471,16 b' def options(cmd, keys, others):'
471 % (cmd, ",".join(others)))
471 % (cmd, ",".join(others)))
472 return opts
472 return opts
473
473
474 # list of commands
475 commands = {}
476
477 def wireprotocommand(name, args=''):
478 """decorator for wireprotocol command"""
479 def register(func):
480 commands[name] = (func, args)
481 return func
482 return register
483
474 def batch(repo, proto, cmds, others):
484 def batch(repo, proto, cmds, others):
475 repo = repo.filtered("served")
485 repo = repo.filtered("served")
476 res = []
486 res = []
@@ -770,7 +780,7 b' def unbundle(repo, proto, heads):'
770 fp.close()
780 fp.close()
771 os.unlink(tempname)
781 os.unlink(tempname)
772
782
773 commands = {
783 commands.update({
774 'batch': (batch, 'cmds *'),
784 'batch': (batch, 'cmds *'),
775 'between': (between, 'pairs'),
785 'between': (between, 'pairs'),
776 'branchmap': (branchmap, ''),
786 'branchmap': (branchmap, ''),
@@ -788,4 +798,4 b' commands = {'
788 'pushkey': (pushkey, 'namespace key old new'),
798 'pushkey': (pushkey, 'namespace key old new'),
789 'stream_out': (stream, ''),
799 'stream_out': (stream, ''),
790 'unbundle': (unbundle, 'heads'),
800 'unbundle': (unbundle, 'heads'),
791 }
801 })
General Comments 0
You need to be logged in to leave comments. Login now