##// 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 b' class queue(object):'
1112 raise util.Abort(_('cannot write patch "%s": %s')
1112 raise util.Abort(_('cannot write patch "%s": %s')
1113 % (patchfn, e.strerror))
1113 % (patchfn, e.strerror))
1114 try:
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 defaultmsg = "[mq]: %s" % patchfn
1115 defaultmsg = "[mq]: %s" % patchfn
1130 editor = cmdutil.getcommiteditor(editform=editform)
1116 editor = cmdutil.getcommiteditor(editform=editform)
1131 if edit:
1117 if edit:
@@ -1154,11 +1140,17 b' class queue(object):'
1154 self.seriesdirty = True
1140 self.seriesdirty = True
1155 self.applieddirty = True
1141 self.applieddirty = True
1156 nctx = repo[n]
1142 nctx = repo[n]
1157 if nctx.description() != defaultmsg.rstrip():
1143 ph = patchheader(self.join(patchfn), self.plainmode)
1158 msg = nctx.description() + "\n\n"
1144 if user:
1159 p.write(msg)
1145 ph.setuser(user)
1160 elif not self.plainmode or date or user:
1146 if date:
1161 p.write('\n')
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 if commitfiles:
1154 if commitfiles:
1163 parent = self.qparents(repo, n)
1155 parent = self.qparents(repo, n)
1164 if inclsubs:
1156 if inclsubs:
General Comments 0
You need to be logged in to leave comments. Login now