Show More
@@ -394,7 +394,7 b' class bzmysql(bzaccess):' | |||
|
394 | 394 | if ret: |
|
395 | 395 | self.ui.warn(out) |
|
396 | 396 | raise util.Abort(_('bugzilla notify command %s') % |
|
397 |
util.explain |
|
|
397 | util.explainexit(ret)[0]) | |
|
398 | 398 | self.ui.status(_('done\n')) |
|
399 | 399 | |
|
400 | 400 | def get_user_id(self, user): |
@@ -308,7 +308,7 b' class commandline(object):' | |||
|
308 | 308 | if output: |
|
309 | 309 | self.ui.warn(_('%s error:\n') % self.command) |
|
310 | 310 | self.ui.warn(output) |
|
311 |
msg = util.explain |
|
|
311 | msg = util.explainexit(status)[0] | |
|
312 | 312 | raise util.Abort('%s %s' % (self.command, msg)) |
|
313 | 313 | |
|
314 | 314 | def run0(self, cmd, *args, **kwargs): |
@@ -109,7 +109,7 b' def _exthook(ui, repo, name, cmd, args, ' | |||
|
109 | 109 | else: |
|
110 | 110 | r = util.system(cmd, environ=env, cwd=cwd) |
|
111 | 111 | if r: |
|
112 |
desc, r = util.explain |
|
|
112 | desc, r = util.explainexit(r) | |
|
113 | 113 | if throw: |
|
114 | 114 | raise util.Abort(_('%s hook %s') % (name, desc)) |
|
115 | 115 | ui.warn(_('warning: %s hook %s\n') % (name, desc)) |
@@ -91,7 +91,7 b' def _sendmail(ui, sender, recipients, ms' | |||
|
91 | 91 | if ret: |
|
92 | 92 | raise util.Abort('%s %s' % ( |
|
93 | 93 | os.path.basename(program.split(None, 1)[0]), |
|
94 |
util.explain |
|
|
94 | util.explainexit(ret)[0])) | |
|
95 | 95 | |
|
96 | 96 | def connect(ui): |
|
97 | 97 | '''make a mail connection. return a function to send mail. |
@@ -1191,7 +1191,7 b' def _externalpatch(patcher, patchname, u' | |||
|
1191 | 1191 | code = fp.close() |
|
1192 | 1192 | if code: |
|
1193 | 1193 | raise PatchError(_("patch command failed: %s") % |
|
1194 |
util.explain |
|
|
1194 | util.explainexit(code)[0]) | |
|
1195 | 1195 | return fuzz |
|
1196 | 1196 | |
|
1197 | 1197 | def internalpatch(patchobj, ui, strip, cwd, files=None, eolmode='strict'): |
@@ -210,7 +210,7 b' def testpid(pid):' | |||
|
210 | 210 | except OSError, inst: |
|
211 | 211 | return inst.errno != errno.ESRCH |
|
212 | 212 | |
|
213 |
def explain |
|
|
213 | def explainexit(code): | |
|
214 | 214 | """return a 2-tuple (desc, code) describing a subprocess status |
|
215 | 215 | (codes from kill are negative - not os.system/wait encoding)""" |
|
216 | 216 | if code >= 0: |
@@ -197,7 +197,7 b' def tempfilter(s, cmd):' | |||
|
197 | 197 | code = 0 |
|
198 | 198 | if code: |
|
199 | 199 | raise Abort(_("command '%s' failed: %s") % |
|
200 |
(cmd, explain |
|
|
200 | (cmd, explainexit(code))) | |
|
201 | 201 | fp = open(outname, 'rb') |
|
202 | 202 | r = fp.read() |
|
203 | 203 | fp.close() |
@@ -369,7 +369,7 b' def system(cmd, environ={}, cwd=None, on' | |||
|
369 | 369 | rc = 0 |
|
370 | 370 | if rc and onerr: |
|
371 | 371 | errmsg = '%s %s' % (os.path.basename(origcmd.split(None, 1)[0]), |
|
372 |
explain |
|
|
372 | explainexit(rc)[0]) | |
|
373 | 373 | if errprefix: |
|
374 | 374 | errmsg = '%s: %s' % (errprefix, errmsg) |
|
375 | 375 | try: |
@@ -155,7 +155,7 b" def popen(command, mode='r'):" | |||
|
155 | 155 | command += " 2> %s" % nulldev |
|
156 | 156 | return os.popen(quotecommand(command), mode) |
|
157 | 157 | |
|
158 |
def explain |
|
|
158 | def explainexit(code): | |
|
159 | 159 | return _("exited with status %d") % code, code |
|
160 | 160 | |
|
161 | 161 | # if you change this stub into a real check, please try to implement the |
General Comments 0
You need to be logged in to leave comments.
Login now