##// 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 471 % (cmd, ",".join(others)))
472 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 484 def batch(repo, proto, cmds, others):
475 485 repo = repo.filtered("served")
476 486 res = []
@@ -770,7 +780,7 b' def unbundle(repo, proto, heads):'
770 780 fp.close()
771 781 os.unlink(tempname)
772 782
773 commands = {
783 commands.update({
774 784 'batch': (batch, 'cmds *'),
775 785 'between': (between, 'pairs'),
776 786 'branchmap': (branchmap, ''),
@@ -788,4 +798,4 b' commands = {'
788 798 'pushkey': (pushkey, 'namespace key old new'),
789 799 'stream_out': (stream, ''),
790 800 'unbundle': (unbundle, 'heads'),
791 }
801 })
General Comments 0
You need to be logged in to leave comments. Login now