[PATCH] patchbomb: no traceback if (diffstat) confirmation is refused
Christian Ebert
blacktrash at gmx.net
Fri Oct 26 12:18:03 UTC 2007
1 files changed, 4 insertions(+), 3 deletions(-)
hgext/patchbomb.py | 7 ++++---
# HG changeset patch
# User Christian Ebert <blacktrash at gmx.net>
# Date 1193400930 -7200
# Node ID 23eb486be6ef957e0be29cd13982d5e028301766
# Parent 04f033a03b1dad90488e45ab1c6f1967309c9a2a
patchbomb: no traceback if (diffstat) confirmation is refused
diff --git a/hgext/patchbomb.py b/hgext/patchbomb.py
--- a/hgext/patchbomb.py
+++ b/hgext/patchbomb.py
@@ -130,9 +130,9 @@ def patchbomb(ui, repo, *revs, **opts):
if empty_ok: return r
ui.warn(_('Please enter a valid value.\n'))
- def confirm(s):
+ def confirm(s, denial):
if not prompt(s, default = 'y', rest = '? ').lower().startswith('y'):
- raise ValueError
+ raise util.Abort(denial)
def cdiffstat(summary, patchlines):
s = patch.diffstat(patchlines)
@@ -140,7 +140,8 @@ def patchbomb(ui, repo, *revs, **opts):
if summary:
ui.write(summary, '\n')
ui.write(s, '\n')
- confirm(_('Does the diffstat above look okay'))
+ confirm(_('Does the diffstat above look okay'),
+ _('diffstat not accepted'))
elif s is None:
ui.warn(_('No diffstat information available.\n'))
s = ''
More information about the Mercurial-devel
mailing list