hgext/mq.py
changeset 35956 d41e41d11574
parent 35928 c8e2d6ed1f9e
child 35958 e35616bb6ede
equal deleted inserted replaced
35955:83b9f96ce20f 35956:d41e41d11574
   394         if message:
   394         if message:
   395             if self.plainmode and self.comments and self.comments[-1]:
   395             if self.plainmode and self.comments and self.comments[-1]:
   396                 self.comments.append('')
   396                 self.comments.append('')
   397             self.comments.append(message)
   397             self.comments.append(message)
   398 
   398 
   399     def __str__(self):
   399     def __bytes__(self):
   400         s = '\n'.join(self.comments).rstrip()
   400         s = '\n'.join(self.comments).rstrip()
   401         if not s:
   401         if not s:
   402             return ''
   402             return ''
   403         return s + '\n\n'
   403         return s + '\n\n'
       
   404 
       
   405     __str__ = encoding.strmethod(__bytes__)
   404 
   406 
   405     def _delmsg(self):
   407     def _delmsg(self):
   406         '''Remove existing message, keeping the rest of the comments fields.
   408         '''Remove existing message, keeping the rest of the comments fields.
   407         If comments contains 'subject: ', message will prepend
   409         If comments contains 'subject: ', message will prepend
   408         the field and a blank line.'''
   410         the field and a blank line.'''