##// END OF EJS Templates
mq: write headers of new patches using patchheader
Mads Kiilerich -
r22547:3d616d27 default
parent child Browse files
Show More
@@ -1112,20 +1112,6 class queue(object):
1112 1112 raise util.Abort(_('cannot write patch "%s": %s')
1113 1113 % (patchfn, e.strerror))
1114 1114 try:
1115 if self.plainmode:
1116 if user:
1117 p.write("From: " + user + "\n")
1118 if date:
1119 p.write("Date: %d %d\n" % date)
1120 else:
1121 p.write("# HG changeset patch\n")
1122 if user:
1123 p.write("# User " + user + "\n")
1124 if date:
1125 p.write("# Date %s %s\n" % date)
1126 p.write("# Parent "
1127 + hex(repo[None].p1().node()) + "\n")
1128
1129 1115 defaultmsg = "[mq]: %s" % patchfn
1130 1116 editor = cmdutil.getcommiteditor(editform=editform)
1131 1117 if edit:
@@ -1154,11 +1140,17 class queue(object):
1154 1140 self.seriesdirty = True
1155 1141 self.applieddirty = True
1156 1142 nctx = repo[n]
1157 if nctx.description() != defaultmsg.rstrip():
1158 msg = nctx.description() + "\n\n"
1159 p.write(msg)
1160 elif not self.plainmode or date or user:
1161 p.write('\n')
1143 ph = patchheader(self.join(patchfn), self.plainmode)
1144 if user:
1145 ph.setuser(user)
1146 if date:
1147 ph.setdate('%s %s' % date)
1148 ph.setparent(hex(nctx.p1().node()))
1149 msg = nctx.description().strip()
1150 if msg == defaultmsg.strip():
1151 msg = ''
1152 ph.setmessage(msg)
1153 p.write(str(ph))
1162 1154 if commitfiles:
1163 1155 parent = self.qparents(repo, n)
1164 1156 if inclsubs:
General Comments 0
You need to be logged in to leave comments. Login now