# HG changeset patch # User Idan Kamara # Date 2011-06-22 14:13:04 # Node ID c19de7f32961f29ea22a07e2ac23a8772930b2ca # Parent 0c81948636f369748df584e1bba18ad31de1371e cmdserver: write the hello message as one chunk on the 'o' channel This is a guaranteed by the protocol: clients know they need to read one chunk off of the 'o' channel and treat that as the hello message. They should ignore fields they don't recognize so they stay compatible with new versions of the server in case we decide to add something. diff --git a/mercurial/commandserver.py b/mercurial/commandserver.py --- a/mercurial/commandserver.py +++ b/mercurial/commandserver.py @@ -205,8 +205,12 @@ class server(object): 'getencoding' : getencoding} def serve(self): - self.cout.write('capabilities: %s' % ' '.join(self.capabilities.keys())) - self.cout.write('encoding: %s' % encoding.encoding) + hellomsg = 'capabilities: ' + ' '.join(self.capabilities.keys()) + hellomsg += '\n' + hellomsg += 'encoding: ' + encoding.encoding + + # write the hello msg in -one- chunk + self.cout.write(hellomsg) try: while self.serveone():