comparison mercurial/wireproto.py @ 20911:1bb8ed6c000c

wireproto: use decorator for the capabilities command
author Pierre-Yves David <pierre-yves.david@fb.com>
date Fri, 28 Mar 2014 14:37:28 -0700
parents acbfce12fafd
children 96ecb77f971d
comparison
equal deleted inserted replaced
20910:acbfce12fafd 20911:1bb8ed6c000c
569 caps.append('httpheader=1024') 569 caps.append('httpheader=1024')
570 return caps 570 return caps
571 571
572 # If you are writting and extension and consider wrapping this function. Wrap 572 # If you are writting and extension and consider wrapping this function. Wrap
573 # `_capabilities` instead. 573 # `_capabilities` instead.
574 @wireprotocommand('capabilities')
574 def capabilities(repo, proto): 575 def capabilities(repo, proto):
575 return ' '.join(_capabilities(repo, proto)) 576 return ' '.join(_capabilities(repo, proto))
576 577
577 def changegroup(repo, proto, roots): 578 def changegroup(repo, proto, roots):
578 nodes = decodelist(roots) 579 nodes = decodelist(roots)
783 finally: 784 finally:
784 fp.close() 785 fp.close()
785 os.unlink(tempname) 786 os.unlink(tempname)
786 787
787 commands.update({ 788 commands.update({
788 'capabilities': (capabilities, ''),
789 'changegroup': (changegroup, 'roots'), 789 'changegroup': (changegroup, 'roots'),
790 'changegroupsubset': (changegroupsubset, 'bases heads'), 790 'changegroupsubset': (changegroupsubset, 'bases heads'),
791 'debugwireargs': (debugwireargs, 'one two *'), 791 'debugwireargs': (debugwireargs, 'one two *'),
792 'getbundle': (getbundle, '*'), 792 'getbundle': (getbundle, '*'),
793 'heads': (heads, ''), 793 'heads': (heads, ''),