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

mail settings
Date May 5, 2015, 9:31 p.m.
Message ID <>
Download mbox | patch
Permalink /patch/8911/
State Not Applicable
Headers show

Comments - May 5, 2015, 9:31 p.m.

          Priority: normal
            Bug ID: 4646
           Summary: enabling pager without color results in a hang
          Severity: bug
    Classification: Unclassified
                OS: Other
          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/

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)
    [ /usr/lib/python2.7/vendor-packages/mercurial/ (_runcatch)

bisect tracks this down to

    changeset:   24074:0baf41e02a4d
    user:        Gregory Szorc <>
    date:        Fri Feb 06 13:09:09 2015 -0700
    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.


--- /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/ (_runpager) ]
    [ /usr/lib/python2.7/vendor-packages/hgext/ (pagecmd) ]
    [ /usr/lib/python2.7/vendor-packages/mercurial/ (closure)
+   [ /usr/lib/python2.7/vendor-packages/hgext/ (pagecmd) ]
+   [ /usr/lib/python2.7/vendor-packages/mercurial/ (closure)
    [ /usr/lib/python2.7/vendor-packages/mercurial/ (runcommand)