Show More
@@ -28,23 +28,39 b' def run():' | |||||
28 |
|
28 | |||
29 | def dispatch(req): |
|
29 | def dispatch(req): | |
30 | "run the command specified in req.args" |
|
30 | "run the command specified in req.args" | |
|
31 | if req.ferr: | |||
|
32 | ferr = req.ferr | |||
|
33 | elif req.ui: | |||
|
34 | ferr = req.ui.ferr | |||
|
35 | else: | |||
|
36 | ferr = sys.stderr | |||
|
37 | ||||
31 | try: |
|
38 | try: | |
32 | if not req.ui: |
|
39 | if not req.ui: | |
33 | req.ui = uimod.ui() |
|
40 | req.ui = uimod.ui() | |
34 | if '--traceback' in req.args: |
|
41 | if '--traceback' in req.args: | |
35 | req.ui.setconfig('ui', 'traceback', 'on') |
|
42 | req.ui.setconfig('ui', 'traceback', 'on') | |
|
43 | ||||
|
44 | # set ui streams from the request | |||
|
45 | if req.fin: | |||
|
46 | req.ui.fin = req.fin | |||
|
47 | if req.fout: | |||
|
48 | req.ui.fout = req.fout | |||
|
49 | if req.ferr: | |||
|
50 | req.ui.ferr = req.ferr | |||
36 | except util.Abort, inst: |
|
51 | except util.Abort, inst: | |
37 |
|
|
52 | ferr.write(_("abort: %s\n") % inst) | |
38 | if inst.hint: |
|
53 | if inst.hint: | |
39 |
|
|
54 | ferr.write(_("(%s)\n") % inst.hint) | |
40 | return -1 |
|
55 | return -1 | |
41 | except error.ParseError, inst: |
|
56 | except error.ParseError, inst: | |
42 | if len(inst.args) > 1: |
|
57 | if len(inst.args) > 1: | |
43 |
|
|
58 | ferr.write(_("hg: parse error at %s: %s\n") % | |
44 | (inst.args[1], inst.args[0])) |
|
59 | (inst.args[1], inst.args[0])) | |
45 | else: |
|
60 | else: | |
46 |
|
|
61 | ferr.write(_("hg: parse error: %s\n") % inst.args[0]) | |
47 | return -1 |
|
62 | return -1 | |
|
63 | ||||
48 | return _runcatch(req) |
|
64 | return _runcatch(req) | |
49 |
|
65 | |||
50 | def _runcatch(req): |
|
66 | def _runcatch(req): |
General Comments 0
You need to be logged in to leave comments.
Login now