mercurial/commandserver.py
changeset 30263 7f2313450e86
parent 29609 591c3badff2e
child 30473 39d13b8c101d
equal deleted inserted replaced
30262:bc5d0e6fd9f3 30263:7f2313450e86
    52         return '<%c-channel>' % self.channel
    52         return '<%c-channel>' % self.channel
    53 
    53 
    54     def write(self, data):
    54     def write(self, data):
    55         if not data:
    55         if not data:
    56             return
    56             return
    57         self.out.write(struct.pack('>cI', self.channel, len(data)))
    57         # single write() to guarantee the same atomicity as the underlying file
    58         self.out.write(data)
    58         self.out.write(struct.pack('>cI', self.channel, len(data)) + data)
    59         self.out.flush()
    59         self.out.flush()
    60 
    60 
    61     def __getattr__(self, attr):
    61     def __getattr__(self, attr):
    62         if attr in ('isatty', 'fileno', 'tell', 'seek'):
    62         if attr in ('isatty', 'fileno', 'tell', 'seek'):
    63             raise AttributeError(attr)
    63             raise AttributeError(attr)