comparison mercurial/dispatch.py @ 20122:8f4a226c840c

dispatch: turn off custom debugger for HGPLAIN mode Some debuggers, such as ipdb, load escape codes and color codes even when later turned off. This will affect scripts that do simple parsing and can't handle escape codes. Therefore, we only load a custom debugger if ui.plain() is false.
author Sean Farley <sean.michael.farley@gmail.com>
date Mon, 25 Nov 2013 12:20:39 -0500
parents 472fa3b782b1
children 03d345da0579
comparison
equal deleted inserted replaced
20121:2af9e1d40dc7 20122:8f4a226c840c
104 # copy configs that were passed on the cmdline (--config) to 104 # copy configs that were passed on the cmdline (--config) to
105 # the repo ui 105 # the repo ui
106 for cfg in cfgs: 106 for cfg in cfgs:
107 req.repo.ui.setconfig(*cfg) 107 req.repo.ui.setconfig(*cfg)
108 108
109 # if we are in HGPLAIN mode, then disable custom debugging
109 debugger = ui.config("ui", "debugger") 110 debugger = ui.config("ui", "debugger")
110 if not debugger: 111 if not debugger or ui.plain():
111 debugger = 'pdb' 112 debugger = 'pdb'
112 113
113 try: 114 try:
114 debugmod = __import__(debugger) 115 debugmod = __import__(debugger)
115 except ImportError: 116 except ImportError: