Patchwork [Bug,4646] New: enabling pager without color results in a hang

login
register
mail settings
Submitter mercurial-bugs@selenic.com
Date May 5, 2015, 9:31 p.m.
Message ID <bug-4646-285@http.bz.selenic.com/>
Download mbox | patch
Permalink /patch/8911/
State Not Applicable
Headers show

Comments

mercurial-bugs@selenic.com - May 5, 2015, 9:31 p.m.
http://bz.selenic.com/show_bug.cgi?id=4646

          Priority: normal
            Bug ID: 4646
                CC: mercurial-devel@selenic.com
          Assignee: bugzilla@selenic.com
           Summary: enabling pager without color results in a hang
          Severity: bug
    Classification: Unclassified
                OS: Other
          Reporter: danek.duvall@oracle.com
          Hardware: PC
            Status: UNCONFIRMED
           Version: 3.4
         Component: Mercurial
           Product: Mercurial

The following command:

    HGRCPATH= hg --config extensions.hgext.pager= --config pager.pager="more" \
        --config "pager.attend=log" log hgext/__init__.py

at least on Solaris, hangs.  Same with less instead of more, though once the
output grows beyond a screen, the behaviors get a bit more complex.

It seems that the pager is actually getting executed twice, executed twice, as
evidenced by truss (strace).  If I grab the stack at the two points of fork,
they're identical, except that the second time, it seems to have recursed once:

$ diff -u =(grep \\\[ /tmp/stack1) =(grep \\\[ /tmp/stack2)
]
    [ /usr/lib/python2.7/vendor-packages/mercurial/dispatch.py:885 (_dispatch)
]
    [ /usr/lib/python2.7/vendor-packages/mercurial/dispatch.py:160 (_runcatch)
]

bisect tracks this down to

    changeset:   24074:0baf41e02a4d
    user:        Gregory Szorc <gregory.szorc@gmail.com>
    date:        Fri Feb 06 13:09:09 2015 -0700
    description:
    pager: ensure wrapped dispatch._runcommand runs before color's

though I suspect it's not actually that patch, but the interaction between that
patch and another one in the series, so I've marked this as a bug in the core,
rather than in either the pager or the color extensions.

Note that the tests pass as expected.

Patch

--- /tmp/zshaFaieV      Tue May  5 14:15:59 2015
+++ /tmp/zshbFaieV      Tue May  5 14:15:59 2015
@@ -4,6 +4,8 @@ 
    [ /usr/lib/python2.7/vendor-packages/hgext/pager.py:117 (_runpager) ]
    [ /usr/lib/python2.7/vendor-packages/hgext/pager.py:159 (pagecmd) ]
    [ /usr/lib/python2.7/vendor-packages/mercurial/extensions.py:164 (closure)
]
+   [ /usr/lib/python2.7/vendor-packages/hgext/pager.py:160 (pagecmd) ]
+   [ /usr/lib/python2.7/vendor-packages/mercurial/extensions.py:164 (closure)
]
    [ /usr/lib/python2.7/vendor-packages/mercurial/dispatch.py:646 (runcommand)