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