Show More
@@ -76,11 +76,11 b' from mercurial import cmdutil, commands,' | |||||
76 | from mercurial.i18n import _ |
|
76 | from mercurial.i18n import _ | |
77 | from mercurial.node import bin |
|
77 | from mercurial.node import bin | |
78 |
|
78 | |||
79 |
def prompt(ui, prompt, default='', rest=': |
|
79 | def prompt(ui, prompt, default='', rest=':', empty_ok=False): | |
80 | if not ui.interactive(): |
|
80 | if not ui.interactive(): | |
81 | if default or empty_ok: |
|
81 | if default or empty_ok: | |
82 | return default |
|
82 | return default | |
83 | raise util.Abort(_("%sPlease enter a valid value" % (prompt+rest))) |
|
83 | raise util.Abort(_("%s Please enter a valid value" % (prompt+rest))) | |
84 | if default: |
|
84 | if default: | |
85 | prompt += ' [%s]' % default |
|
85 | prompt += ' [%s]' % default | |
86 | prompt += rest |
|
86 | prompt += rest | |
@@ -99,7 +99,7 b' def cdiffstat(ui, summary, patchlines):' | |||||
99 | if summary: |
|
99 | if summary: | |
100 | ui.write(summary, '\n') |
|
100 | ui.write(summary, '\n') | |
101 | ui.write(s, '\n') |
|
101 | ui.write(s, '\n') | |
102 |
ans = prompt(ui, _('does the diffstat above look okay? |
|
102 | ans = prompt(ui, _('does the diffstat above look okay?'), 'y') | |
103 | if not ans.lower().startswith('y'): |
|
103 | if not ans.lower().startswith('y'): | |
104 | raise util.Abort(_('diffstat rejected')) |
|
104 | raise util.Abort(_('diffstat rejected')) | |
105 | return s |
|
105 | return s | |
@@ -330,10 +330,11 b' def patchbomb(ui, repo, *revs, **opts):' | |||||
330 |
|
330 | |||
331 | flag = ' '.join(opts.get('flag')) |
|
331 | flag = ' '.join(opts.get('flag')) | |
332 | if flag: |
|
332 | if flag: | |
333 |
subj = '[PATCH %0*d of %d %s] |
|
333 | subj = '[PATCH %0*d of %d %s]' % (tlen, 0, len(patches), flag) | |
334 | else: |
|
334 | else: | |
335 |
subj = '[PATCH %0*d of %d] |
|
335 | subj = '[PATCH %0*d of %d]' % (tlen, 0, len(patches)) | |
336 |
subj += opts.get('subject') or |
|
336 | subj += ' ' + (opts.get('subject') or | |
|
337 | prompt(ui, 'Subject: ', rest=subj)) | |||
337 |
|
338 | |||
338 | body = '' |
|
339 | body = '' | |
339 | if opts.get('diffstat'): |
|
340 | if opts.get('diffstat'): |
@@ -1177,7 +1177,7 b' diff -r eae5fcf795ee -r e317db6a6f28 .hg' | |||||
1177 | +ff2c9fa2018b15fa74b33363bda9527323e2a99f two |
|
1177 | +ff2c9fa2018b15fa74b33363bda9527323e2a99f two | |
1178 | +ff2c9fa2018b15fa74b33363bda9527323e2a99f two.diff |
|
1178 | +ff2c9fa2018b15fa74b33363bda9527323e2a99f two.diff | |
1179 |
|
1179 | |||
1180 | abort: Subject:[PATCH 0 of 2] Please enter a valid value |
|
1180 | abort: Subject: [PATCH 0 of 2] Please enter a valid value | |
1181 | This patch series consists of 2 patches. |
|
1181 | This patch series consists of 2 patches. | |
1182 |
|
1182 | |||
1183 | This patch series consists of 2 patches. |
|
1183 | This patch series consists of 2 patches. |
General Comments 0
You need to be logged in to leave comments.
Login now