##// END OF EJS Templates
mq: simplify patchheader handling of the empty line before the diff...
Mads Kiilerich -
r22522:382c2be6 default
parent child Browse files
Show More
@@ -191,7 +191,6 b' class patchheader(object):'
191
191
192 # make sure message isn't empty
192 # make sure message isn't empty
193 if format and format.startswith("tag") and subject:
193 if format and format.startswith("tag") and subject:
194 message.insert(0, "")
195 message.insert(0, subject)
194 message.insert(0, subject)
196
195
197 self.message = message
196 self.message = message
@@ -214,7 +213,7 b' class patchheader(object):'
214 if self.plainmode or self._hasheader(['Date: ']):
213 if self.plainmode or self._hasheader(['Date: ']):
215 self.comments = ['From: ' + user] + self.comments
214 self.comments = ['From: ' + user] + self.comments
216 else:
215 else:
217 tmp = ['# HG changeset patch', '# User ' + user, '']
216 tmp = ['# HG changeset patch', '# User ' + user]
218 self.comments = tmp + self.comments
217 self.comments = tmp + self.comments
219 self.user = user
218 self.user = user
220
219
@@ -227,7 +226,7 b' class patchheader(object):'
227 if self.plainmode or self._hasheader(['From: ']):
226 if self.plainmode or self._hasheader(['From: ']):
228 self.comments = ['Date: ' + date] + self.comments
227 self.comments = ['Date: ' + date] + self.comments
229 else:
228 else:
230 tmp = ['# HG changeset patch', '# Date ' + date, '']
229 tmp = ['# HG changeset patch', '# Date ' + date]
231 self.comments = tmp + self.comments
230 self.comments = tmp + self.comments
232 self.date = date
231 self.date = date
233
232
@@ -268,9 +267,10 b' class patchheader(object):'
268 return False
267 return False
269
268
270 def __str__(self):
269 def __str__(self):
271 if not self.comments:
270 s = '\n'.join(self.comments).rstrip()
271 if not s:
272 return ''
272 return ''
273 return '\n'.join(self.comments) + '\n\n'
273 return s + '\n\n'
274
274
275 def _delmsg(self):
275 def _delmsg(self):
276 '''Remove existing message, keeping the rest of the comments fields.
276 '''Remove existing message, keeping the rest of the comments fields.
General Comments 0
You need to be logged in to leave comments. Login now