comparison mercurial/wireproto.py @ 20922:588e24f3eea3

wireproto: use decorator for the stream command
author Pierre-Yves David <pierre-yves.david@fb.com>
date Fri, 28 Mar 2014 14:43:11 -0700
parents 70ed3174ce69
children d771641b7051
comparison
equal deleted inserted replaced
20921:70ed3174ce69 20922:588e24f3eea3
681 681
682 def _walkstreamfiles(repo): 682 def _walkstreamfiles(repo):
683 # this is it's own function so extensions can override it 683 # this is it's own function so extensions can override it
684 return repo.store.walk() 684 return repo.store.walk()
685 685
686 @wireprotocommand('stream_out')
686 def stream(repo, proto): 687 def stream(repo, proto):
687 '''If the server supports streaming clone, it advertises the "stream" 688 '''If the server supports streaming clone, it advertises the "stream"
688 capability with a value representing the version and flags of the repo 689 capability with a value representing the version and flags of the repo
689 it is serving. Client checks to see if it understands the format. 690 it is serving. Client checks to see if it understands the format.
690 691
794 finally: 795 finally:
795 fp.close() 796 fp.close()
796 os.unlink(tempname) 797 os.unlink(tempname)
797 798
798 commands.update({ 799 commands.update({
799 'stream_out': (stream, ''),
800 'unbundle': (unbundle, 'heads'), 800 'unbundle': (unbundle, 'heads'),
801 }) 801 })