Show More
@@ -115,9 +115,6 b' def _runpager(ui, p):' | |||||
115 | pager.wait() |
|
115 | pager.wait() | |
116 |
|
116 | |||
117 | def uisetup(ui): |
|
117 | def uisetup(ui): | |
118 | if '--debugger' in sys.argv or not ui.formatted(): |
|
|||
119 | return |
|
|||
120 |
|
||||
121 | class pagerui(ui.__class__): |
|
118 | class pagerui(ui.__class__): | |
122 | def _runpager(self, pagercmd): |
|
119 | def _runpager(self, pagercmd): | |
123 | _runpager(self, pagercmd) |
|
120 | _runpager(self, pagercmd) | |
@@ -130,7 +127,7 b' def uisetup(ui):' | |||||
130 | always = util.parsebool(options['pager']) |
|
127 | always = util.parsebool(options['pager']) | |
131 | auto = options['pager'] == 'auto' |
|
128 | auto = options['pager'] == 'auto' | |
132 |
|
129 | |||
133 | if not p: |
|
130 | if not p or '--debugger' in sys.argv or not ui.formatted(): | |
134 | pass |
|
131 | pass | |
135 | elif always: |
|
132 | elif always: | |
136 | usepager = True |
|
133 | usepager = True |
@@ -32,6 +32,38 b' long socket path' | |||||
32 |
|
32 | |||
33 | $ cd .. |
|
33 | $ cd .. | |
34 |
|
34 | |||
|
35 | pager | |||
|
36 | ----- | |||
|
37 | ||||
|
38 | $ cat >> fakepager.py <<EOF | |||
|
39 | > import sys | |||
|
40 | > for line in sys.stdin: | |||
|
41 | > sys.stdout.write('paged! %r\n' % line) | |||
|
42 | > EOF | |||
|
43 | ||||
|
44 | enable pager extension globally, but spawns the master server with no tty: | |||
|
45 | ||||
|
46 | $ chg init pager | |||
|
47 | $ cd pager | |||
|
48 | $ cat >> $HGRCPATH <<EOF | |||
|
49 | > [extensions] | |||
|
50 | > pager = | |||
|
51 | > [pager] | |||
|
52 | > pager = python $TESTTMP/fakepager.py | |||
|
53 | > EOF | |||
|
54 | $ chg version > /dev/null | |||
|
55 | $ touch foo | |||
|
56 | $ chg ci -qAm foo | |||
|
57 | ||||
|
58 | pager should be enabled if the attached client has a tty: | |||
|
59 | ||||
|
60 | $ chg log -l1 -q --config ui.formatted=True | |||
|
61 | paged! '0:1f7b0de80e11\n' | |||
|
62 | $ chg log -l1 -q --config ui.formatted=False | |||
|
63 | 0:1f7b0de80e11 | |||
|
64 | ||||
|
65 | $ cd .. | |||
|
66 | ||||
35 | server lifecycle |
|
67 | server lifecycle | |
36 | ---------------- |
|
68 | ---------------- | |
37 |
|
69 |
@@ -152,6 +152,11 b" doesn't result in history being paged." | |||||
152 | summary: modify a 9 |
|
152 | summary: modify a 9 | |
153 |
|
153 | |||
154 |
|
154 | |||
|
155 | Pager should not start if stdout is not a tty. | |||
|
156 | ||||
|
157 | $ hg log -l1 -q --config ui.formatted=False | |||
|
158 | 10:46106edeeb38 | |||
|
159 | ||||
155 | Pager with color enabled allows colors to come through by default, |
|
160 | Pager with color enabled allows colors to come through by default, | |
156 | even though stdout is no longer a tty. |
|
161 | even though stdout is no longer a tty. | |
157 | $ cat >> $HGRCPATH <<EOF |
|
162 | $ cat >> $HGRCPATH <<EOF |
General Comments 0
You need to be logged in to leave comments.
Login now