Patchwork [1,of,9,py3,v3] ui: check for --debugger in sys.argv using r-string to avoid bytes on py3

login
register
mail settings
Submitter Augie Fackler
Date March 12, 2017, 5:59 p.m.
Message ID <b2106f4f2502bc94defa.1489341549@augie-macbookair2.roam.corp.google.com>
Download mbox | patch
Permalink /patch/19189/
State Accepted
Headers show

Comments

Augie Fackler - March 12, 2017, 5:59 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1489283469 18000
#      Sat Mar 11 20:51:09 2017 -0500
# Node ID b2106f4f2502bc94defa43e33c7b9b18fe726f95
# Parent  1c3352d7eaf24533ad52d4b8a024211e9189fb0b
ui: check for --debugger in sys.argv using r-string to avoid bytes on py3

Our source loader was errantly turning this --debugger into a bytes,
which was then causing me to still get a pager when I was using the
debugger on py3. That made life hard.
Yuya Nishihara - March 12, 2017, 6:20 p.m.
On Sun, 12 Mar 2017 13:59:09 -0400, Augie Fackler wrote:
> # HG changeset patch
> # User Augie Fackler <augie@google.com>
> # Date 1489283469 18000
> #      Sat Mar 11 20:51:09 2017 -0500
> # Node ID b2106f4f2502bc94defa43e33c7b9b18fe726f95
> # Parent  1c3352d7eaf24533ad52d4b8a024211e9189fb0b
> ui: check for --debugger in sys.argv using r-string to avoid bytes on py3

Looks generally good. I've queued this version, thanks.

Patch

diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -901,7 +901,7 @@  class ui(object):
             or not self.formatted()
             or self.plain()
             # TODO: expose debugger-enabled on the UI object
-            or '--debugger' in sys.argv):
+            or '--debugger' in pycompat.sysargv):
             # We only want to paginate if the ui appears to be
             # interactive, the user didn't say HGPLAIN or
             # HGPLAINEXCEPT=pager, and the user didn't specify --debug.