##// END OF EJS Templates
mq: introduce insertplainheader - same naive implementation as before
Mads Kiilerich -
r23345:83cbf556 stable
parent child Browse files
Show More
@@ -150,6 +150,10 b' def inserthgheader(lines, header, value)'
150 lines.append(header + value)
150 lines.append(header + value)
151 return lines
151 return lines
152
152
153 def insertplainheader(lines, header, value):
154 lines.insert(0, '%s: %s' % (header, value))
155 return lines
156
153 class patchheader(object):
157 class patchheader(object):
154 def __init__(self, pf, plainmode=False):
158 def __init__(self, pf, plainmode=False):
155 def eatdiff(lines):
159 def eatdiff(lines):
@@ -260,7 +264,7 b' class patchheader(object):'
260 inserthgheader(self.comments, '# User ', user)
264 inserthgheader(self.comments, '# User ', user)
261 except ValueError:
265 except ValueError:
262 if self.plainmode:
266 if self.plainmode:
263 self.comments = ['From: ' + user] + self.comments
267 insertplainheader(self.comments, 'From', user)
264 else:
268 else:
265 tmp = ['# HG changeset patch', '# User ' + user]
269 tmp = ['# HG changeset patch', '# User ' + user]
266 self.comments = tmp + self.comments
270 self.comments = tmp + self.comments
@@ -272,7 +276,7 b' class patchheader(object):'
272 inserthgheader(self.comments, '# Date ', date)
276 inserthgheader(self.comments, '# Date ', date)
273 except ValueError:
277 except ValueError:
274 if self.plainmode:
278 if self.plainmode:
275 self.comments = ['Date: ' + date] + self.comments
279 insertplainheader(self.comments, 'Date', date)
276 else:
280 else:
277 tmp = ['# HG changeset patch', '# Date ' + date]
281 tmp = ['# HG changeset patch', '# Date ' + date]
278 self.comments = tmp + self.comments
282 self.comments = tmp + self.comments
General Comments 0
You need to be logged in to leave comments. Login now