##// END OF EJS Templates
[patchbomb] prepend leading zeros in the "[PATCH N of M]" string...
Josef "Jeff" Sipek -
r3291:0b5d626b default
parent child Browse files
Show More
@@ -158,7 +158,8 b' def patchbomb(ui, repo, *revs, **opts):'
158 if total == 1:
158 if total == 1:
159 subj = '[PATCH] ' + desc[0].strip()
159 subj = '[PATCH] ' + desc[0].strip()
160 else:
160 else:
161 subj = '[PATCH %d of %d] %s' % (idx, total, desc[0].strip())
161 tlen = len(str(total))
162 subj = '[PATCH %0*d of %d] %s' % (tlen, idx, total, desc[0].strip())
162 if subj.endswith('.'): subj = subj[:-1]
163 if subj.endswith('.'): subj = subj[:-1]
163 msg['Subject'] = subj
164 msg['Subject'] = subj
164 msg['X-Mercurial-Node'] = node
165 msg['X-Mercurial-Node'] = node
@@ -217,10 +218,14 b' def patchbomb(ui, repo, *revs, **opts):'
217 if len(patches) > 1:
218 if len(patches) > 1:
218 ui.write(_('\nWrite the introductory message for the patch series.\n\n'))
219 ui.write(_('\nWrite the introductory message for the patch series.\n\n'))
219
220
220 subj = '[PATCH 0 of %d] %s' % (
221 tlen = len(str(len(patches)))
222
223 subj = '[PATCH %0*d of %d] %s' % (
224 tlen, 0,
221 len(patches),
225 len(patches),
222 opts['subject'] or
226 opts['subject'] or
223 prompt('Subject:', rest = ' [PATCH 0 of %d] ' % len(patches)))
227 prompt('Subject:', rest = ' [PATCH %0*d of %d] ' % (tlen, 0,
228 len(patches))))
224
229
225 ui.write(_('Finish with ^D or a dot on a line by itself.\n\n'))
230 ui.write(_('Finish with ^D or a dot on a line by itself.\n\n'))
226
231
General Comments 0
You need to be logged in to leave comments. Login now