Patchwork [01,of,11,V3] dispatch: turn off custom debugger for HGPLAIN mode

mail settings
Submitter Sean Farley
Date Nov. 25, 2013, 5:42 p.m.
Message ID <>
Download mbox | patch
Permalink /patch/3121/
State Superseded
Commit 8f4a226c840c38b905c5cba2596d8ffe3cd27bca
Headers show


Sean Farley - Nov. 25, 2013, 5:42 p.m.
# HG changeset patch
# User Sean Farley <>
# Date 1385400039 18000
#      Mon Nov 25 12:20:39 2013 -0500
# Node ID 45892c8fe1d557842ab6b64ba91b26b04a56e5ac
# Parent  0f01d0692bc54551bc62c64f3dfd793708bd901b
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.


diff --git a/mercurial/ b/mercurial/
--- a/mercurial/
+++ b/mercurial/
@@ -104,12 +104,13 @@ 
                 # copy configs that were passed on the cmdline (--config) to
                 # the repo ui
                 for cfg in cfgs:
+            # if we are in HGPLAIN mode, then disable custom debugging
             debugger = ui.config("ui", "debugger")
-            if not debugger:
+            if not debugger or ui.plain():
                 debugger = 'pdb'
                 debugmod = __import__(debugger)
             except ImportError: