changeset 23271:76302f5ceba4

util.system: remove unused handling of onerr=ui In our code, onerr is None or util.Abort. It smells bad to overload ui and exception class.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 08 Nov 2014 13:14:19 +0900
parents 41c03b7592ed
children 394c79df66c3
files mercurial/util.py
diffstat 1 files changed, 3 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/util.py	Sat Nov 08 13:06:22 2014 +0900
+++ b/mercurial/util.py	Sat Nov 08 13:14:19 2014 +0900
@@ -619,9 +619,8 @@
     '''enhanced shell command execution.
     run with environment maybe modified, maybe in different dir.
 
-    if command fails and onerr is None, return status.  if ui object,
-    print error message and return status, else raise onerr object as
-    exception.
+    if command fails and onerr is None, return status, else raise onerr
+    object as exception.
 
     if out is specified, it is assumed to be a file-like object that has a
     write() method. stdout and stderr will be redirected to out.'''
@@ -670,10 +669,7 @@
                             explainexit(rc)[0])
         if errprefix:
             errmsg = '%s: %s' % (errprefix, errmsg)
-        try:
-            onerr.warn(errmsg + '\n')
-        except AttributeError:
-            raise onerr(errmsg)
+        raise onerr(errmsg)
     return rc
 
 def checksignature(func):